Jump to content
scotspgc

Msgbox without line break

Recommended Posts

I know this might be a simple thing but I cant seem to figure out how to have a msgbox display without having the text always have a line break.

I have included a sample of the script I am trying to create.

Global $configfile = @ScriptDir & "\DbaseBkp.ini"
Global $dbinstance = IniRead ($configfile, "database", "dbinstance", "0")
Global $sqlcmdpath = IniRead ($configfile, "paths", "sqlcmdpath", "0")
Global $dbase01bkpscript = IniRead ($configfile, "database", "dbase01bkpscript", "0")

MsgBox(0,"Debug3","""" & $sqlcmdpath & """ -S " & $dbinstance & " -i " & $dbase01bkpscript)

I am adding a debug line of code to display the correct command line creation for sql backup scripts but I need the msgbox to display the full command line string as a single unbroken line.

I know this can be done in a gui control but I would prefer this to be done in a msgbox if at all possible.

 

Thanks

Share this post


Link to post
Share on other sites

@scotspgc

If the line in the MsgBox became too long, then a new line character is added automatically.

If you want to use a MsgBox style form, then you need to create your own; otherwise, if you are just debugging, you could use ConsoleWrite() :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
Posted (edited)

Francesco is right.

Another possibility you can use is to add a "debug mode" to your script and log the debugging information to a text file:

$debug_mode = 1
$debug_file = FileOpen(@ScriptDir & "\debug.txt", 9) ; 9 = create if not exist and continue writing at the end of file

Global $configfile = @ScriptDir & "\DbaseBkp.ini"
Global $dbinstance = IniRead ($configfile, "database", "dbinstance", "0")
Global $sqlcmdpath = IniRead ($configfile, "paths", "sqlcmdpath", "0")
Global $dbase01bkpscript = IniRead ($configfile, "database", "dbase01bkpscript", "0")

if $debug_mode = 1 then FileWrite($debug_file, "Debug3","""" & $sqlcmdpath & """ -S " & $dbinstance & " -i " & $dbase01bkpscript & @CRLF)

FileClose($debug_file)

This way you dont have to comment all your debug lines then remove the comments each time, just change $debug_mode to 1 then 0 :)

Edited by Neutro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...