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
  • As far as I know, you are correct.  The help file says: "The items between the IF and the END IF commands will only execute if the expression for the IF command evaluates to true (nonzero)". 

    I haven't tried that with string variables.  It would seem to me that any string that is not empty would then evaluate as true.  It could be a quick way to check if a user entered data on input comment.  However, I just tried this and found that assigning a string with "0000" actually returns a FALSE.  So, there is an edge case where that wouldn't work.  

Reply
  • As far as I know, you are correct.  The help file says: "The items between the IF and the END IF commands will only execute if the expression for the IF command evaluates to true (nonzero)". 

    I haven't tried that with string variables.  It would seem to me that any string that is not empty would then evaluate as true.  It could be a quick way to check if a user entered data on input comment.  However, I just tried this and found that assigning a string with "0000" actually returns a FALSE.  So, there is an edge case where that wouldn't work.  

Children
No Data