- GOTO SCREEN begin *>SCREEN begin - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "This section initializes the variables. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: dim dat(6) dat(1)=100 dat(2)=200 dat(3)=300 dat(4)=400 dat(5)=500 dat(6)=600 - GET BACKGROUND STYLE SETUP: 1 - GOTO SCREEN runscr - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "Tell about the program. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: *>SCREEN runscr - PUT TEXT AT (1,1): "REVERSE VIDEO DATA ENTRY EXAMPLE:" - PUT TEXT AT (3,2): "This program demonstrates the use of" - PUT TEXT AT (1,3): "a REVERSE VIDEO cursor. It is started" - PUT TEXT AT (1,4): "by pressing the softkey. Numeric data" - PUT TEXT AT (1,5): "is entered, and the EDIT softkey. The" - PUT TEXT AT (1,6): "UP and DOWN arrows select the field." - PUT TEXT AT (1,7): "Press a number and ENTER to save." - SOFTKEY (1) "RUN" GOTO SCREEN runloop - SOFTKEY WAIT - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "This is the main run loop or a screen which " :::::::::::: - TITLE:::::::::: "dislays the data prior to the editing process. " :::::::::::: - TITLE:::::::::: "Softkey 1 enables the edit function. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: *>SCREEN runloop - PUT TEXT AT (1,1): "PERFORM DATA ENTRY:" - PUT TEXT AT (1,2): "DATA #1: UNITS" - PUT TEXT AT (1,3): "DATA #2: UNITS" - PUT TEXT AT (1,4): "DATA #3: UNITS" - PUT TEXT AT (1,5): "DATA #4: UNITS" - PUT TEXT AT (1,6): "DATA #5: UNITS" - PUT TEXT AT (1,7): "DATA #6: UNITS" - PUT NUMBER dat(1) AT (10,2) USING "####.#" - PUT NUMBER dat(2) AT (10,3) USING "####.#" - PUT NUMBER dat(3) AT (10,4) USING "####.#" - PUT NUMBER dat(4) AT (10,5) USING "####.#" - PUT NUMBER dat(5) AT (10,6) USING "####.#" - PUT NUMBER dat(6) AT (10,7) USING "####.#" - SOFTKEY (1) "EDIT" GOTO SCREEN editscr - SOFTKEY (6) "EXIT" GOTO SCREEN exitscr - SOFTKEY WAIT - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "This screen (used quick so background text are " :::::::::::: - TITLE:::::::::: "not erased), allows the operator to press the " :::::::::::: - TITLE:::::::::: "UP or DOWN arrow keys to scroll through the " :::::::::::: - TITLE:::::::::: "data fields. The selected field will become " :::::::::::: - TITLE:::::::::: "reverse video when selected. " :::::::::::: - TITLE:::::::::: " " :::::::::::: - TITLE:::::::::: "The object is to wait for an UP, DOWN or NUMBER" :::::::::::: - TITLE:::::::::: "key to be pressed, and then operate on it. " :::::::::::: - TITLE:::::::::: " " :::::::::::: - TITLE:::::::::: "CALL ZH and CALL ZI are used with CALL NKEY to " :::::::::::: - TITLE:::::::::: "form a loop which is contantly editing a key. " :::::::::::: - TITLE:::::::::: "ZH is the setup part of the GET NUMBER pseudo- " :::::::::::: - TITLE:::::::::: "code, and ZI is the terminal part of it. If " :::::::::::: - TITLE:::::::::: "your application needs to check something else " :::::::::::: - TITLE:::::::::: "while this loop is running, put your code where" :::::::::::: - TITLE:::::::::: "the 'put it here message' message is. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: *>SCREEN QUICK editscr index%=1 fmt$="####.#" key (1), "EDIT" - LABEL editscr1 CALL ZH(index%+1,10,fmt$,ZBLDVID%,dat(index%)) - LABEL editscr2 'put any code here that you need inside the loop. call NKEY(ZBLDN$,ZBLDN%) if ZBLDN%>42 and ZBLDN%<58 then goto editscr2 if ZBLDN%=20480 then gosub nxtnum if ZBLDN%=18432 then gosub prevnum if ZBLDN%=15104 then goto runloop IF ZBLDN%<>13 then goto editscr2 call ZI() dat(index%)=VAL(ZBLDN$) gosub nxtnum goto editscr2 - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "The operator has pressed the UP arrow key. We " :::::::::::: - TITLE:::::::::: "must highlight the cursor. Here, the PUT " :::::::::::: - TITLE:::::::::: "NUMBER pseudocode call (ZA) has been used for " :::::::::::: - TITLE:::::::::: "optimum performance. " :::::::::::: - TITLE:::::::::: " " :::::::::::: - TITLE:::::::::: "The number presently selected is restored, and " :::::::::::: - TITLE:::::::::: "the next new number is highlighted. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - LABEL nxtnum 'CALL ZA(0... is the PUT NUMBER pseduocode BASIC call CALL ZA(0,index%+1,10,fmt$,dat(index%)) 'clear background graphics CALL BOX(0,0,239,55,100) index%=index%+1 if index% > 6 then index%=6 CALL ZH(index%+1,10,fmt$,ZBLDVID%,dat(index%)) - RETURN - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "The operator has pressed the DOWN arrow key. " :::::::::::: - TITLE:::::::::: "This is similar in operaton to the UP arrow " :::::::::::: - TITLE:::::::::: "function. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - LABEL prevnum 'CALL ZA(0... is the PUT NUMBER pseduocode BASIC call CALL ZA(0,index%+1,10,fmt$,dat(index%)) 'clear background graphics CALL BOX(0,0,239,55,100) index%=index%-1 if index% < 1 then index%=1 CALL ZH(index%+1,10,fmt$,ZBLDVID%,dat(index%)) - RETURN - TITLE:::::::::: "-----------------------------------------------" :::::::::::: - TITLE:::::::::: "Return to BASIC. " :::::::::::: - TITLE:::::::::: "-----------------------------------------------" :::::::::::: *>SCREEN exitscr - PUT LARGE TEXT AT (1,1): "THANK YOU FOR USING" - PUT LARGE TEXT AT (2,2): "EASON TECHNOLOGY" pos 1,7 - DELAY 2500 - END OF PSEUDOCODE