On Thursday, September 7, 2023 at 8:25:30 PM UTC-7, Jonathan Harston wrote:
Is there a way to use strings in expressions in ZMAC, so I can do
the following more efficiently:
Maybe it would be enough to just do the month as a macro?
VersMM macro
defm 'Mar'
endm
DEFM '0'+(VersDD/10),'0'+(VersDD MOD 10),'-'
VersMM
DEFM '-'
Or use irp to do the month number to name lookup in a cleaner fashion:
VersMM equ 7
m1=0
irp s1,<Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec>
if VersMM == m1
defm '&s1'
endif
m1++
endm
For the year you can stringify it doing something like this:
VersYY equ 2000
str macro sx
defm '&sx'
endm
str %VersYY
Though I guess the answer to your question is that zmac doesn't have string variables and you need to use macros to get the same kind of manipulation.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)