01-01-2023, 07:20 AM
Macro Macro3240
out
str A="1 key"
str Av=
;1 hello
;1 world
str B="2 key"
str Bv=
;2 hello
;2 world
str C="3 key"
str Cv=
;3 hello
;3 world
str endStr
;;;the above code can contain any number of str variable pairs. Don't insert other variables in between.
sub.kvs(&A &endStr)
#sub kvs
function'str str*firstStr str*endStr
int i n=(endStr-firstStr)/sizeof(str)/2
for i 0 n
,str& X=firstStr[i*2]
,str& Xv=firstStr[i*2+1]
,out F"{i}, X={X}, Xv={Xv}"