Specifications

4-34 Programmer’s Guide Sega
Psy-Q Development System
WHILE, ENDW
Description These directives allow the programmer to repeat the code between the WHILE and
ENDW statements, as long as the expression in the operand holds true.
Syntax WHILE expression
...
ENDW
See Also REPT, DO
Remarks Currently, any string equate substitutions in the WHILE expression take place once
only, when the WHILE loop is first encountered - see Note below for the
ramifications of this.
Examples MultP equ 16
...
Indic = MultP
while Indic>1
move.w term(a0),d0
...
Indic = Indic-1
endw
Note Because string equates are only evaluated at the start of the WHILE loop, the
following will not work:
s equs "x"
while strlen("\s") < 4
dc.b "\s",0
s equs "\s\x"
endw