|
Post by Johnc on Aug 31, 2018 1:13:08 GMT
Hi Steve, Sorry I couldn't find an example in the MMM manual. So I tried the following 2 lines but both didn't work. %STRING1% contained "|" at the end. What is wrong? I am very confused. Please help. Tks!
1 | IF | STRING VARIABLE | %STRING4% | IS | USA | DEFINE STRING VARIABLE | %STRING1% | This is America | ELSE | 5 | RUN ACTION | | | | DEFINE STRING VARIABLE | %STRING1% | This is not America
1 | IF | STRING VARIABLE | %STRING4% | IS | USA | DEFINE STRING VARIABLE | %STRING1% | This is America | ELSE | 5 | IF | %STRING4% | IS | ASIA | DEFINE STRING VARIABLE | %STRING1% | This is Asia | ELSE | 9 | RUN ACTION | | | | DEFINE STRING VARIABLE | %STRING1% | This is Europe
|
|
|
Post by Steve on Aug 31, 2018 2:03:05 GMT
Hi John, Can you do me a solid and wrap your macro lines in code blocks, it makes it easier to read and copy. Code blocks can be used by clicking on the 'C' "Insert Code" button in the format bar.
1. This works:
1 | RUN ACTION | | | | MESSAGE PROMPT | string4=%string4% string1=%string1%::String Values 2 | IF | STRING VARIABLE | %STRING4% | IS | USA | DEFINE STRING VARIABLE | %STRING1%::This is America | ELSE | 1 | RUN ACTION | | | | DEFINE STRING VARIABLE | %STRING1%::This is not America 3 | RUN ACTION | | | | MESSAGE PROMPT | string4=%string4% string1=%string1%::String Values Do you have any errors in the MMM event log? Your line looks ok other than the format issue after your RUN ACTION: Your RUN ACTION is RUN ACTION | | | | DEFINE STRING VARIABLE This should be RUN ACTION | | | | DEFINE STRING VARIABLE
2. This works:
1 | RUN ACTION | | | | MESSAGE PROMPT | string4=%string4% string1=%string1%::String Values 2 | IF | STRING VARIABLE | %STRING4% | IS | USA | DEFINE STRING VARIABLE | %STRING1%::This is America 4 | IF | STRING VARIABLE | %STRING4% | IS | ASIA | DEFINE STRING VARIABLE | %STRING1%::This is Asia | ELSE | 5 | IF | STRING VARIABLE | %STRING4% | IS NOT | USA | DEFINE STRING VARIABLE | %STRING1%::This is Europe 5 | RUN ACTION | | | | MESSAGE PROMPT | string4=%string4% string1=%string1%::String Values Your syntax for the line is wrong. You have nested two ELSE statements. For this to work you need to define the logic like the solution above. Regards, Steve.
|
|
|
Post by Johnc on Aug 31, 2018 11:11:12 GMT
Thanks so much Steve! You are the best! Your script worked when run in isolation as above. However, not sure why it is not working when I copied it exactly into my big macro. Always returned "This is not America". Something is not right here... I really need to learn how to use the log file...
|
|