|
Post by snowday on Jan 7, 2021 17:41:45 GMT
As seen in this example.
1 | IF | FILE | C:\MMM\Skip.mmmacro | EXIST | GOTO MACRO LINE | 5 | ELSE | 1 | RUN ACTION | GOTO MACRO LINE | 2
Right after ELSE there's a 1, but I don't understand what it does.
|
|
|
Post by Steve on Jan 9, 2021 9:31:17 GMT
Hi snowdayThe '1' doesn't perform a function it's really just visually for reference. Writing out line 1's condition statement in words here might help explain: 1 | IF | FILE | C:\MMM\Skip.mmmacro | EXIST | GOTO MACRO LINE | 5 | ELSE | 1 | RUN ACTION | GOTO MACRO LINE | 2 Macro line 1 - If the file c:\mmm\skip.mmmacro exists then goto macro line 5. If this evaluates to true (the file exists) then we perform the action to go to macro list line 5. If this evaluates to false (the file does not exist) then we start a new line 1 condition being to run the action to go to the macro list line 2. Hope this helps....hope i haven't confused it further.
|
|
|
Post by snowday on Jan 14, 2021 16:55:48 GMT
Hi snowday The '1' doesn't perform a function it's really just visually for reference. Writing out line 1's condition statement in words here might help explain: 1 | IF | FILE | C:\MMM\Skip.mmmacro | EXIST | GOTO MACRO LINE | 5 | ELSE | 1 | RUN ACTION | GOTO MACRO LINE | 2 Macro line 1 - If the file c:\mmm\skip.mmmacro exists then goto macro line 5. If this evaluates to true (the file exists) then we perform the action to go to macro list line 5. If this evaluates to false (the file does not exist) then we start a new line 1 condition being to run the action to go to the macro list line 2. Hope this helps....hope i haven't confused it further. So it's necessary to have as filler for the correct syntax but its value is irrelevant? I just wanted to be sure the number wasn't specifically necessary to be of a certain value for debugging purposes. If having it "1" was important for correct referencing, like, it had to be the same as the number at the beginning of the IF/ELSE. At one point I had actually wondered if it's treated like a brand new line that simply didn't get its own entry, and therefore specifically shouldn't have the same number as any other line. I'm certain I once wrote a macro that was something like this following when I was trying to figure out why IF/ELSE wasn't working.
1 | Some stuff 2 | IF some stuff | GOTO MACRO LINE | 4 | ELSE | 3 | GOTO MACRO LINE | 5 4 | Do some stuff 5 | Do some other stuff
(I think later I figured out it was the absence of RUN ACTION following ELSE)
|
|
|
Post by Steve on Jan 19, 2021 9:46:28 GMT
So it's necessary to have as filler for the correct syntax but its value is irrelevant? I just wanted to be sure the number wasn't specifically necessary to be of a certain value for debugging purposes. If having it "1" was important for correct referencing, like, it had to be the same as the number at the beginning of the IF/ELSE. At one point I had actually wondered if it's treated like a brand new line that simply didn't get its own entry, and therefore specifically shouldn't have the same number as any other line. I'm certain I once wrote a macro that was something like this following when I was trying to figure out why IF/ELSE wasn't working.
1 | Some stuff 2 | IF some stuff | GOTO MACRO LINE | 4 | ELSE | 3 | GOTO MACRO LINE | 5 4 | Do some stuff 5 | Do some other stuff
(I think later I figured out it was the absence of RUN ACTION following ELSE)
Yes you are right on the money here. It's necessary for the syntax but the value is irrelevant however, as your 5 line macro shows, its useful to visual display the macro flow and can be helpful in debugging to keep the value in sequence.
|
|
|
Post by zeak on Jan 22, 2021 4:05:57 GMT
Hi Snowday,
If you are not concerned with the number after the ELSE then you can change it to X and the else will still run.
1 | IF | FILE | C:\MMM\Skip.mmmacro | EXIST | GOTO MACRO LINE | 5 | ELSE | X | RUN ACTION | GOTO MACRO LINE | 2 This also works when relisting rows.
|
|