Code Sample of If / End If

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?

IF/C1.INPUT=="YES"

PNT1=FEAT/POINT,RECT

ENDMEAS/

END_IF/

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.

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.