Code Sample of Else / End Else

Consider the following example that asks the user if he or she would like to measure a point feature.

C1= COMMENT/YESNO,Would you like to measure the point feature, PNT1? Clicking No measures the next feature.
IF/C1.INPUT=="YES"
   PNT1=FEAT/POINT,RECT
   …
   …
   ENDMEAS/
END_IF/
ELSE
   PNT2=FEAT/POINT,RECT
   …
   …
   ENDMEAS/
END_ELSE

Explanation of Sample Code

C1=COMMENT/YESNO
This line takes and stores the YES or NO response from the user.

IF/C1.INPUT=="YES"
This line is the expression. It tests to see if the input of comment 1 is a YES. If it's a YES then the IF statement is TRUE and continues executing the statements after the IF statement, in this case it measures the PNT1 feature. If NO it moves to the END_IF statement.

END_IF
This line ends the execution of commands inside the IF / END IF block of code. Any command following this line is where PC-DMIS will go to if the user clicks No at the comment.

ELSE
If the above IF / END IF block evaluates to false then command lines falling after this line and before the END_ELSE line will be executed. In this case, PNT2 gets executed.

END_ELSE
This line ends the execution of commands inside the ELSE / END_ELSE block of code.

Command Mode Commands after Comments

After you insert a PC-DMIS comment, to type additional PC-DMIS commands in Command mode, you must first press Enter twice after the COMMENT command. This tells PC-DMIS that you no longer want to add text to the comment but are ready to add a new command.