hexagon logo

Inserting a Variable into a COMMENT/OPER

This returns 0

The syntax is killing me....

What am I missing?


ASSIGN/PART_NO=TEST
COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
"Load Part " +PART_NO​
Parents
  • Because it's ambiguous whether you're just showing text or displaying a variable, doing what you're trying to do is often finicky. First, make sure your variable is defined properly - I don't know whether TEST in your code above is a second previously-defined variable, or if you're trying to assign the string "TEST" to your PART_NO variable. If the latter, you probably need to put quotes around it for it to work.

    Second, you need to make sure the comment knows to read the variable and not simply display the text PART_NO. If you see your plus sign and/or the variable name in the comment output text, you'll need to start over. Delete the comment, then recreate it, and make sure that you type the line (double quotes, plus sign, etc.) right on the first try. If at any point you leave the line with an invalid expression, PC-DMIS will assume you just wanted to show the text, and changing its mind is difficult.

    With all due respect, I disagree with - I'm pretty sure you can get it to do the right thing with or without spaces. It's whether or not the whole thing is a valid expression that matters (and has been in the past, which is frustrating...)
Reply
  • Because it's ambiguous whether you're just showing text or displaying a variable, doing what you're trying to do is often finicky. First, make sure your variable is defined properly - I don't know whether TEST in your code above is a second previously-defined variable, or if you're trying to assign the string "TEST" to your PART_NO variable. If the latter, you probably need to put quotes around it for it to work.

    Second, you need to make sure the comment knows to read the variable and not simply display the text PART_NO. If you see your plus sign and/or the variable name in the comment output text, you'll need to start over. Delete the comment, then recreate it, and make sure that you type the line (double quotes, plus sign, etc.) right on the first try. If at any point you leave the line with an invalid expression, PC-DMIS will assume you just wanted to show the text, and changing its mind is difficult.

    With all due respect, I disagree with - I'm pretty sure you can get it to do the right thing with or without spaces. It's whether or not the whole thing is a valid expression that matters (and has been in the past, which is frustrating...)
Children
No Data