flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > if ~ defined -> error |
Author |
|
revolution 15 Feb 2021, 01:21
Jin X wrote: But I want to stop on the 1st error message. Assert will allow more passes to resolve variables before erroring. Err will immediately halt. |
|||
15 Feb 2021, 01:21 |
|
Jin X 15 Feb 2021, 16:47
Yeah, I understand.
I've defined a const to show only first error with assert But now I have another problem: Code: macro tst x { if ~ defined x display 'Error!' assert 0 end if } tst a qqq a rb 1 Here I see message "Error!". qqq generates an error and a becomes undefined. This creates a sense of error in the wrong place. Is there's a way to avoid "display"ing the custom message in this case. |
|||
15 Feb 2021, 16:47 |
|
revolution 16 Feb 2021, 01:21
Move "tst a" further down after the qqq line.
Or change the text to say "x is not defined yet". It isn't actually an error to have undefined variables, so displaying "error" is not strictly correct. |
|||
16 Feb 2021, 01:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.