Jump to content

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

Link to comment
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

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...