how can i escape the "<",">" symbols in *.scr script
i have a line in my *.scr file like this:
send: s rlt=##class(%SYS.Namespace).ListAll(.rlt)<CR>
wait for:USER>
send: S A="" F S A=$O(rlt(A)) q:A="" I A["USER"!(A["CLIE") F I=1:1:$L(L,",") S G="^["""_A_"""]"_$P(L,",",I) S B="" F S B=$O(@G@(B)) Q:B="" F J=1:1:$L(B) S V=$A($E(B,J,J)) I (V<48!(V>57))&&(V<65!(V>90))&&(V<97!(V>122)) W A,?10,G,?30,B,!<CR>
wait for:USER>
it errors out with this <SYNTAX> error where the "<" or ">" are not accepted.
I (V057))&&(VA90))&&(Va122)) W A,?10,G,?30,B,!
How do I escape these characters so that my script works??
Thanks
Comments
i found that if i parameterize my values, it works.
set V48= "V<48"
set V57= "V>57"
set V65= "V<65"
set V90= "V>90"
set V97= "V<97"
set V122= "V>122"
C:\Cachesys\bin\cterm.exe /console=cn_iptcp:%%x[23] C:\Users\................\ERROR_IN_CODES.scr %%x %V48% %V57% %V65% %V90% %V97% %V122%
I (<p2>!(<p3>))&&(<p4>!(<p5>))&&(<p6>!(<p7>))
Note:Any ASCII (extended) character except NUL (000) can be produced via <ddd> where ddd is the decimal value of the character.
USER>w $a("<")
60
USER>w $a(">")
62So, something similar is needed:
echo: off send: s V=4 I (V<60>48!(V<62>57))&&(V<60>65!(V<62>90))&&(V<60>97!(V<62>122)) W A,?10,G,?30,B,!<CR> wait for:USER>
thank you. a very elegant solution.