hexagon logo

PCDMIS True/False Variable Issue

All,

From what I understand, a variable in a PCDMIS conditional statement PCDMIS evaluates True / False conditionals by checking ONLY if the numeric value is ZERO (aka False). Anything else evaluates to True.

In Example 1, the Operator Comment does NOT execute:

ASSIGN/V1=0
IF/V1
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
Hello!
END_IF/ 

In Example 2, the Operator comment executes if V1 is anything OTHER THAN ZERO.

ASSIGN/V1=3
    IF/V1
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Hello!
END_IF/

Has anyone found this NOT to work as described above?

Are there issues if the variable holds a string value?

Thanks,

Mike (in snowy Buffalo)

Parents Reply Children
  • Not true.  It is common in many programming languages to have true/false variables (Boolean variables).  They exist only to store a one or a zero - true or false.  So, you can just use an IF command followed by that variable in conditional statements.  It works in PC-DMIS, but I tend to be squeamish about doing it because you don't declare variable types (I think it uses all variables as variants), so I worry that a zero won't always be considered a true zero.