Skip to main content
10-Marble
April 13, 2017
Solved

ProProgram syntax

  • April 13, 2017
  • 2 replies
  • 1932 views

I have defined a condition for a feature creation in ProProgram which works fine:

IF D42 > 0

...blah...feature definition...

ENDIF

But trying to add a second condition yields this error:

IF D42 > 0 AND D48 > D43

!*** ERR: line contains a bad symbol or is otherwise invalid

Same goes for this attempt:

IF D42 > 0 AND IF D48 > D43

!*** ERR: line contains a bad symbol or is otherwise invalid

I assume this is a syntax error. Can someone please help me out with this?

Best answer by BenLoosli

The conjunction operand is &, not AND.

IF D42 > 0 & D48 > D43

   expressions

ENDIF

You can evaluate any Pro/Program relations in the standard relation editor to see is they work before moving the code to the program.

Check out the WF4 Help Topic Collection Fundamentals.pdf for the symbol syntax for relations.

2 replies

10-Marble
April 13, 2017

A colleague suggested nesting the ifs like this (and it works):


IF D42 > 0

IF D48 > D43

...blah...feature definition...

ENDIF

ENDIF

Still I wonder if there is a way to do the two conditions in one if nest?

BenLoosli23-Emerald IIIAnswer
23-Emerald III
April 13, 2017

The conjunction operand is &, not AND.

IF D42 > 0 & D48 > D43

   expressions

ENDIF

You can evaluate any Pro/Program relations in the standard relation editor to see is they work before moving the code to the program.

Check out the WF4 Help Topic Collection Fundamentals.pdf for the symbol syntax for relations.

10-Marble
April 13, 2017

That works. Thank you.