scotspgc Posted April 5, 2019 Posted April 5, 2019 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
FrancescoDiMuro Posted April 5, 2019 Posted April 5, 2019 @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() Neutro 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Neutro Posted April 5, 2019 Posted April 5, 2019 (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 April 5, 2019 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now