Select a Portion of a Program

From ArcoWiki
Revision as of 13:29, 15 May 2017 by Admin (talk | contribs) (Created page with "During the creation of a DMIS program, it might be necessary to ask the user to make a choice and then the program will execute accordingly.<br /> In order to do so the co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

During the creation of a DMIS program, it might be necessary to ask the user to make a choice and then the program will execute accordingly.
In order to do so the commands SELECT and JUMPTO are useful tools.
This example shows how to ask an user input and then using the combination of a SELECT structure with JUMPTO commands to reach the part of the program required.

(ASK_AGAIN) TEXT/QUERY,(AN_QUERY),40,N,L,'DO YOU WANT TO JUMP SOMEWHERTE? (PRESS 0 FOR NO, 1 FOR YES)' SELECT/AN_QUERY CASE/0

  JUMPTO/(SELECTED_NO)

ENDCAS CASE/1

  JUMPTO/(SELECTED_YES)

ENDCAS DFTCAS

  JUMPTO/(ASK_AGAIN)

ENDCAS ENDSEL

(SELECTED_NO)

     TEXT/OPER,'YOU SELECTED NO'
     JUMPTO/(END_PROGRAM)


(SELECTED_YES)

     TEXT/OPER,'YOU SELECTED YES'

(END_PROGRAM)