Jump to content

Granted This Does Not Work...


Recommended Posts

In VB6 I can use a multiple statements on a line using a : like I tried in the snippet below which obviously does not compile in Scite. I've got a tricky set of loops to debug and for some reason Scite's debug to Msgbox does not work and produces compilation errors. Ideally I'd like to add the MsgBox to the end of the line so that I can at least see the main code clearly and it'll be easy to strip off the MsgBox calls later. Is there an equivalent syntax in AutoIT?

$i = 1 : MsgBox(0, "", $i)
$j = 2 : MsgBox(0, "", $j)
exit

Edit: I could write the following which obviously works but the first is 'cleaner' for my debugging purposes.

$i = 1
MsgBox(0, "", $i)
$j = 2
MsgBox(0, "", $j)
exit

Edit: Following is Scite's Ctrl-Shift-D rendition. Maybe I'm doing something wrong or misunderstanding it what it's meant to be used for? I have no idea what it's meant to produce but it looks a mess.

$i = 1
$j = 2 
exit                                                                    MsgBox(262144,'Debug line ~3','Selection:' & @lf & '$i = 1
$j = 2 
' & @lf & @lf & 'Return:' & @lf & $i = 1
$j = 2 
 & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX
Edited by Peter Hamilton-Scott
Link to comment
Share on other sites

I've seen this mentioned before, but I cannot find the thread.

If I recall correctly, AutoIt's lexer and/or parser relies on line endings pretty heavily, so there really is not any way to combine multiple commands like that on a single line.

There are clever tricks such as

If MsgBox(0,"","one") And Msgbox(0,"","two") Then $x=0

that let you call MsgBox on one line, but this hack is far from clear.

Something that might help would be putting a certain identifier at the end of each debug line such as ;###

Then you could a regular expression for .*###.# and replace with nothing.

(Or you could do

Searth > Find ### Mark Al

Search > Toggle bookmarks

Tools > Insert bookmarked lines)

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...