- GOTO SCREEN begin *>SCREEN begin - COMMENT "recpenum is the current recipe number" - COMMENT "maxrecpe is the maximum number of recipes" - COMMENT "igrdtnum holds the position of the cursor pointer in the recipe" - COMMENT "maxigrdt holds the number of ingredients in each recipe" recpenum=1 maxrecpe=9 igrdtnum=1 maxigrdt=17 - COMMENT "offset is used to get a virtual two dimentional array out of" - COMMENT " the NVOLs one dimentional array. Conversion is done" - COMMENT " by adding the two dimensions, recpenum+igrdtnum, which is" - COMMENT " the number of the recipe + the number of the ingredient" offset=(maxigrdt*(recpenum-1))+1 - COMMENT "Set the edit screen to use reverse video for data entry" - GET BACKGROUND STYLE SETUP: 1 GOTO main *>SCREEN main - PUT LARGE TEXT AT (4,1): "RECIPE EDITOR" - PUT TEXT AT (6,5): " Hit F3 to edit the recipes" - SOFTKEY (2) "EDIT" GOTO SCREEN editor - SOFTKEY (6) "EXIT" GOTO SCREEN exit call cursor(0) - SOFTKEY WAIT *>SCREEN editor label topoedit - COMMENT "Print the recipe labels to the screen" - PUT TEXT AT (1,1): "recipe:" - PUT TEXT AT (15,1): "MICRON RATING" - PUT TEXT AT (1,2): "PRE MELT" - PUT TEXT AT (1,7): "DIEZONE2" - PUT TEXT AT (1,3): "MAINMELT" - PUT TEXT AT (15,2): "DIEZONE3" - PUT TEXT AT (1,4): "HOSE" - PUT TEXT AT (15,3): "DIEZONE4" - PUT TEXT AT (1,5): "AIR TEMP" - PUT TEXT AT (15,4): "DIEZONE5" - PUT TEXT AT (1,6): "DIEZONE1" - PUT TEXT AT (15,5): "DIEZONE6" - PUT TEXT AT (15,6): "DIEZONE7" - PUT TEXT AT (15,7): "DIEZONE8" - PUT TEXT AT (29,2): "PUMP 1" - PUT TEXT AT (29,3): "PUMP 2" - PUT TEXT AT (29,4): "PUMP 3" - PUT TEXT AT (29,5): "PUMP 4" - PUT NUMBER recpenum AT (10,1) USING "##" - PUT NUMBER nvol%(1+offset) AT (29,1) USING "##" - PUT NUMBER nvol%(2+offset) AT (10,2) USING "##" - PUT NUMBER nvol%(3+offset) AT (10,3) USING "##" - PUT NUMBER nvol%(4+offset) AT (10,4) USING "##" - PUT NUMBER nvol%(5+offset) AT (10,5) USING "##" - PUT NUMBER nvol%(6+offset) AT (10,6) USING "##" - PUT NUMBER nvol%(7+offset) AT (10,7) USING "##" - PUT NUMBER nvol%(8+offset) AT (24,2) USING "##" - PUT NUMBER nvol%(9+offset) AT (24,3) USING "##" - PUT NUMBER nvol%(10+offset) AT (24,4) USING "##" - PUT NUMBER nvol%(11+offset) AT (24,5) USING "##" - PUT NUMBER nvol%(12+offset) AT (24,6) USING "##" - PUT NUMBER nvol%(13+offset) AT (24,7) USING "##" - PUT NUMBER nvol%(14+offset) AT (36,2) USING "####" - PUT NUMBER nvol%(15+offset) AT (36,3) USING "####" - PUT NUMBER nvol%(16+offset) AT (36,4) USING "####" - PUT NUMBER nvol%(17+offset) AT (36,5) USING "####" - SOFTKEY (1) "EDIT" GOTO SCREEN editscr - SOFTKEY (2) "PREV" GOTO SCREEN prevscr - SOFTKEY (3) "NEXT" GOTO SCREEN nextscr - SOFTKEY (6) "MAIN" GOTO SCREEN begin call cursor(0) - SOFTKEY WAIT - LABEL prevscr - COMMENT "Check the limits of the cursor" IF recpenum=1 then GOTO topoedit recpenum=recpenum-1 offset=(maxigrdt*(recpenum-1))+1 GOTO topoedit - LABEL nextscr IF recpenum=maxrecpe then GOTO topoedit recpenum=recpenum+1 offset=(maxigrdt*(recpenum-1))+1 GOTO topoedit *>SCREEN loadflt - PUT LARGE TEXT AT (7,1): "WARNING!" - PUT TEXT AT (6,4): "Loading the default values will" - PUT TEXT AT (8,5): "erase the current values of" - PUT TEXT AT (11,6): "the selected recipe!" - SOFTKEY (2) "LOAD" GOTO SCREEN loadvar - SOFTKEY (5) "CANCL" GOTO SCREEN editor - SOFTKEY WAIT *>SCREEN loadvar - COMMENT "Restore the data pointer to the beginning of the data statements" RESTORE - COMMENT "Now adjust the pointer to the current recipe" IF recpenum=1 THEN GOTO readata FOR outloop=1 to (recpenum-1) FOR inloop=1 to maxigrdt READ ignore NEXT inloop NEXT outloop LABEL readata - COMMENT "Now read the data lines into the current recipe." for outloop=1 to maxigrdt READ nvol%((offset+outloop)) next - COMMENT "Note that these data statements are in groups of 17" - COMMENT "Two data lines are used per recipe" DATA 01,01,02,03,04,05,06,07,08,09 DATA 00,01,02,1000,1001,1002,1003 data 03,81,82,83,84,85,86,87,88,89 data 84,84,84,1080,1081,1082,1083 DATA 05,11,12,13,14,15,16,17,18,19 DATA 14,14,14,1010,1011,1012,1013 data 10,21,22,23,24,25,26,27,28,29 data 20,21,22,1020,1021,1022,1023 DATA 35,31,32,33,34,35,36,37,38,39 DATA 30,31,32,1030,1031,1032,1033 data 20,41,42,43,44,45,46,47,48,49 data 40,41,42,1040,1041,1042,1043 DATA 30,51,52,53,54,55,56,57,58,59 DATA 50,51,52,1050,1051,1052,1053 data 40,61,62,63,64,65,66,67,68,65 data 60,61,62,1060,1061,1062,1063 DATA 70,71,72,73,74,75,76,77,78,77 DATA 70,71,72,1070,1071,1072,1073 data 00,00,00,00,00,00,00,00,00,00 data 00,00,00,0000,0000,0000,0000 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,0000,0000,0000,0000 data 00,00,00,00,00,00,00,00,00,00 data 00,00,00,0000,0000,0000,0000 DATA 00,00,00,00,00,00,00,00,00,00 DATA 00,00,00,0000,0000,0000,0000 GOTO topoedit - 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 key (1), "MAIN" key (3), "LOAD" - LABEL editscr1 - COMMENT "Compute edit cursor coordinates based on ingredient number" gosub getxy CALL ZH(y,x,fmt$,ZBLDVID%,NVOL%(index%+offset)) - 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 editor if ZBLDN%=15616 then goto loadflt IF ZBLDN%<>13 then goto editscr2 call ZI() NVOL%(index%+offset)=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 gosub getxy CALL ZA(0,y,x,fmt$,NVOL%(index%+offset)) 'clear background graphics CALL BOX(0,0,239,55,100) index%=index%+1 if index% > maxigrdt then index%=maxigrdt gosub getxy CALL ZH(y,x,fmt$,ZBLDVID%,NVOL%(index%+offset)) - 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 gosub getxy CALL ZA(0,y,x,fmt$,NVOL%(index%+offset)) 'clear background graphics CALL BOX(0,0,239,55,100) index%=index%-1 if index% < 1 then index%=1 gosub getxy CALL ZH(y,x,fmt$,ZBLDVID%,NVOL%(index%+offset)) - RETURN - LABEL getxy - COMMENT "Compute the x, y coordinates for that cursor position" - COMMENT "and the format for that cursor position" IF index%=1 THEN GOTO range1 IF index%<8 THEN GOTO range2 IF index%<14 THEN GOTO range3 GOTO range4 LABEL range1 x=29:y=1:fmt$="##":return LABEL range2 x=10:y=index%:fmt$="##":return LABEL range3 x=24:y=index%-6:fmt$="##":return LABEL range4 x=36:y=index%-12:fmt$="####":return *>SCREEN exit - END OF PSEUDOCODE