User bio
404 bio not found
Member since Apr 27, 2017
Posts:
Replies:
I set $T
to 0 before the if
statement. After the syntax error occurred, I checked the value of $T
. It seems that the interpreter doesn’t differentiate between a block of code and a single line — it still executes the subsequent lines inside the condition
I modified the post slightly. I ran a routine via the terminal, and as expected, it threw a <SYNTAX>
error because the variable x
is undefined. Then I continued the program, and now both the single-line if
statement and the block if
statement (with braces) set all the global variable. I thought that block of code wouldn’t be executed
if $D(@x@(a,b,c)) s ^zz1=1,^x=1,^y=2,^xx=1
;
;
if $D(@x@(a,b,c)) {
set ^zz1=1212
set ^dd=1
set ^fg=2
}
Open Exchange applications:
Certifications & Credly badges:
Ashok Kumar has no Certifications & Credly badges yet.
Global Masters badges:







Followers:
Following:
The code is simple and no hidden implementation. always undefined is set as 2 in our environment so it prevents the
<UNDEFINED>
.I keep the if statement in both single line as well as block structure
s mr=15824,vs="EV1" s x=$S(^pmr(1):$NA(^pmr),1:"") if $d(@x@(mr,vs)) { s ^zxq($now())=@x@(mr,vs) } q