In the following code, im using a single line macro and a multiline macro.
If my understanding of macros is correct, both do exactly as they should,
except that Example 1 should cause a compile time error "Expected END IF"...
I think the syntax is acceptable for the compiler but MACROS do it harder to parse? im a little confused.
Can someone clarify this for me please?
Clear question is: Why is a macro accepted after a single line IF as... well a
multi line macro.. but ignores the result of the first macro and treats the second macro as a separate thing without requiring an END IF statement?
Code:
MACRO DayHasPassed() = ISTRUE(VAL(MID$(DATE$, 7, 4) & MID$(DATE$, 1, 2) & MID$(DATE$, 4, 2)) => 20100101) MACRO DISPLAYGreeting() MSGBOX "This Shouldnt be triggered before 2010." END MACRO FUNCTION PBMAIN AS LONG ' Example 1 IF DayHasPassed() THEN DisplayGreeting() ' Example 2 IF DayHasPassed() THEN DisplayGreeting() END IF END FUNCTION
except that Example 1 should cause a compile time error "Expected END IF"...
I think the syntax is acceptable for the compiler but MACROS do it harder to parse? im a little confused.
Can someone clarify this for me please?
Clear question is: Why is a macro accepted after a single line IF as... well a
multi line macro.. but ignores the result of the first macro and treats the second macro as a separate thing without requiring an END IF statement?
Comment