Post by philranger on Oct 23, 2020 13:43:25 GMT
Hello,
Newbie to MMM, but programming savy if I may say so myself. I have simplified my code to the following, which I test from an empty "Notepad". Whatever I type in the inputbox, nothing gets written.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | 10
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | 20
5 | RUN ACTION | STOP
10 | RUN ACTION | KEYPRESS | Good day mate
15 | RUN ACTION | STOP
20 | RUN ACTION | KEYPRESS | Good evening mlady
25 | RUN ACTION | STOP
But when I change it to the following, it works.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | 5
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | 7
4 | RUN ACTION | STOP
5 | RUN ACTION | KEYPRESS | Good day mate
6 | RUN ACTION | STOP
7 | RUN ACTION | KEYPRESS | Good evening mlady
Since the length of my sections will change in the future, I was wondering if there is a way around it?
Thanks!
EDIT:
Ok, I found a work around: goto a comment instead of goto a specific line number.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | Day
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | Nite
4 | RUN ACTION | STOP
* | Day
5 | RUN ACTION | KEYPRESS | Good day mate
6 | RUN ACTION | STOP
* | Nite
7 | RUN ACTION | KEYPRESS | Good evening mlady
Are there other restrictions about line numbers? Can they be randomly ordered and skipped?
Thanks!
Newbie to MMM, but programming savy if I may say so myself. I have simplified my code to the following, which I test from an empty "Notepad". Whatever I type in the inputbox, nothing gets written.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | 10
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | 20
5 | RUN ACTION | STOP
10 | RUN ACTION | KEYPRESS | Good day mate
15 | RUN ACTION | STOP
20 | RUN ACTION | KEYPRESS | Good evening mlady
25 | RUN ACTION | STOP
But when I change it to the following, it works.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | 5
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | 7
4 | RUN ACTION | STOP
5 | RUN ACTION | KEYPRESS | Good day mate
6 | RUN ACTION | STOP
7 | RUN ACTION | KEYPRESS | Good evening mlady
Since the length of my sections will change in the future, I was wondering if there is a way around it?
Thanks!
EDIT:
Ok, I found a work around: goto a comment instead of goto a specific line number.
1 | RUN ACTION | INPUT BOX | 1=day, 2= night::Time?::STRING
2 | IF | STRING VARIABLE | %STRING% | IS | 1 | GOTO MACRO LINE | Day
3 | IF | STRING VARIABLE | %STRING% | IS | 2 | GOTO MACRO LINE | Nite
4 | RUN ACTION | STOP
* | Day
5 | RUN ACTION | KEYPRESS | Good day mate
6 | RUN ACTION | STOP
* | Nite
7 | RUN ACTION | KEYPRESS | Good evening mlady
Are there other restrictions about line numbers? Can they be randomly ordered and skipped?
Thanks!