flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > 2 if-statements in one macro / error |
Author |
|
Tomasz Grysztar 09 Jul 2006, 16:54
You should not put the structure definitions inside the macro, leave only the structure declarations (the actual instances of the given stuctures) inside it. The structure definition ("struct"-"ends") itself is a kind of macro definition.
|
|||
09 Jul 2006, 16:54 |
|
vid 09 Jul 2006, 20:17
that's why i prefer not overloading "{" and "}", like "idata \{ ... \}" instead of "idata ... endg". of course it's not always possible
|
|||
09 Jul 2006, 20:17 |
|
Tomasz Grysztar 09 Jul 2006, 20:31
The official "struct" macro doesn't overload braces. I haven't checked what kind of macros were applied here, though.
|
|||
09 Jul 2006, 20:31 |
|
Tomasz Grysztar 09 Jul 2006, 20:38
Actually the macro from the first post works with standard 'struct' even in this weird variant. The problem arises when the macro is used second time, no matter whether structures are defined inside or outside. This seems to be some other problem...
|
|||
09 Jul 2006, 20:38 |
|
Tomasz Grysztar 09 Jul 2006, 20:45
OK, found it out: when type is kxButton, this line:
Code: if type eq kxWindow becomes: Code: if kxButton eq kxWindow and thus is interpreted by preprocessor (for which IF has no meaning) as a declaration of structure. Thus the solution is: 1) Move structure definitions outside of the macro, so then won't get defined more than once 2) Replace the lines like: Code: if type eq kxButton with lines like: Code: if <type> eq <kxButton> (or even better it would be to use MATCH). |
|||
09 Jul 2006, 20:45 |
|
derPENGUIN 10 Jul 2006, 04:31
Thank you, Tomasz, it works now with widget-struct outside the macro and "if <type>..."
Great job! |
|||
10 Jul 2006, 04:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.