home *** CD-ROM | disk | FTP | other *** search
- <<* APPMENU.INC *>>
- <<#
-
- function ExpandName( name : string ) : string
- string strg
- integer cp,namelen,count
- begin
- cp := 1
- namelen := len( name )
- strg := replicate( ' ',80 )
- for count := 1 to namelen <<*E-X-P-A-N-D the string*>>
- strg[ cp ] := name[ count ]
- cp := cp + 2
- end
- strg[0] := chr( namelen * 2 - 1 ) <<*Assign the new string length*>>
- RETURN strg
- end ExpandName
-
-
- procedure GenMenuStatus
- string line
- integer col
- begin
- forall databases
- filespec( dbfnam,fpath,fname,fext )
- line := line + fname + space( 8 - len(fname) )
- endfor
- #>>
- @ 0, 0 SAY {"}{line}{"}
- @ 0,72 SAY DATE()
- DO CASE
- <<forall databases>>
- CASE dbfarea = {"}{dbfcount}{"}
- <<col := (dbfcount - 1) * 8>>
- <<GenColor( 1,'HILITE' )>>
- <<filespec( dbfnam,fpath,fname,fext )>>
- <<fname := fname + space( 8 - len(fname) )>>
- @ 0,{col} SAY {"}{fname}{"}
- <<endfor>>
- ENDCASE
- <<GenColor( 0,'SCREEN' )>>
- <<end GenMenuStatus>>
-
-
- <<procedure GenSingleLiteBar>>
- <<begin>>
- PARAMETER choice
- PRIVATE col
- <<GenColor( 0,'SCREEN' )>>
- CLEAR
- * ---Center the menu heading.
- <<fname := ExpandName( menutitle )>>
- menuhdg = {"}{fname} M A I N M E N U{"}
- col = (80 - LEN(menuhdg)) / 2
- @ 1,0 TO 15,79 DOUBLE
- @ 3, 0 SAY "╠═══════════════════════════════════════"
- @ 3,40 SAY "═══════════════════════════════════════╣"
- @ 2,col SAY menuhdg
- <<GenColor( 0,'PROMPT' )>>
- SET MESSAGE TO 17
- menuchoice = AT( choice,"QABEHLPR" )
- IF (menuchoice < 1) .OR. (menuchoice > 8)
- menuchoice = 4
- ENDIF
- col = 33
- @ 5,col PROMPT " 0. Quit " MESSAGE "Return to DOS"
- @ 6,col PROMPT " 1. Append " MESSAGE "Add New Records"
- @ 7,col PROMPT " 2. Browse " MESSAGE "Browse Existing Records"
- @ 8,col PROMPT " 3. Edit/View " MESSAGE "View, Change, Delete Records"
- @ 9,col PROMPT " 4. Help " MESSAGE "See System Structure"
- @ 10,col PROMPT " 5. Labels " MESSAGE "Print Mailing Labels"
- @ 11,col PROMPT " 6. Pack " MESSAGE "Remove Deleted Records"
- @ 12,col PROMPT " 7. Report " MESSAGE "Print Report(s)"
- * ---Press <ESC>, <Return>, <PgDn> or the first character "1"..."7".
- * ---Assigns 0 (on <ESC>) or 1 thru 7 to menuchoice.
- MENU TO menuchoice
- choice = SUBSTR( "QQABEHLPR",menuchoice + 1,1 )
- * ---Release row 17.
- SET MESSAGE TO
- * ---Save menu selection.
- <<end GenSingleLiteBar>>
-
-
- <<procedure GenMultiLiteBar>>
- <<begin>>
- PARAMETER choice
- PRIVATE col
- <<GenColor( 0,'SCREEN' )>>
- CLEAR
- <<GenMenuStatus>>
- * ---Center the menu heading.
- <<fname := ExpandName( menutitle )>>
- menuhdg = {"}{fname} M A I N M E N U{"}
- col = (80 - LEN(menuhdg)) / 2
- @ 1,0 TO 16,79 DOUBLE
- @ 3, 0 SAY "╠═══════════════════════════════════════"
- @ 3,40 SAY "═══════════════════════════════════════╣"
- @ 2,col SAY menuhdg
- <<GenColor( 0,'PROMPT' )>>
- SET MESSAGE TO 18
- menuchoice = AT( choice,"QABEHLPRS" )
- IF (menuchoice < 1) .OR. (menuchoice > 9)
- menuchoice = 4
- ENDIF
- col = 33
- @ 5,col PROMPT " 0. Quit " MESSAGE "Return to DOS"
- @ 6,col PROMPT " 1. Append " MESSAGE "Add New Records"
- @ 7,col PROMPT " 2. Browse " MESSAGE "Browse Existing Records"
- @ 8,col PROMPT " 3. Edit/View " MESSAGE "View, Change, Delete Records"
- @ 9,col PROMPT " 4. Help " MESSAGE "See System Structure"
- @ 10,col PROMPT " 5. Labels " MESSAGE "Print Mailing Labels"
- @ 11,col PROMPT " 6. Pack " MESSAGE "Remove Deleted Records"
- @ 12,col PROMPT " 7. Report " MESSAGE "Print Report(s)"
- @ 13,col PROMPT " 8. Select " MESSAGE "Select Database File"
- * ---Press <ESC>, <Return>, <PgDn> or the first character "1"..."8".
- * ---Assigns 0 (on <ESC>) or 1 thru 8 to menuchoice.
- MENU TO menuchoice
- choice = SUBSTR( "QQABEHLPRS",menuchoice + 1,1 )
- * ---Release row 18.
- SET MESSAGE TO
- * ---Save menu selection.
- <<end GenMultiLiteBar>>
-
-
- <<#
- procedure GenLiteBarMenu
- begin
- if ismultials
- GenMultiLiteBar
- else
- GenSingleLiteBar
- endif
- end GenLiteBarMenu
- #>>
-
-
- <<procedure GenMultiSimple>>
- <<integer row>>
- <<string line>>
- <<begin>>
- PARAMETER choice
- PRIVATE col
- <<GenColor( 0,'SCREEN' )>>
- CLEAR
- <<GenMenuStatus>>
- * ---Center the menu heading.
- <<fname := ExpandName( menutitle )>>
- menuhdg = {"}{fname} M A I N M E N U{"}
- col = (80 - LEN(menuhdg)) / 2
- @ 1,0 TO 16,79 DOUBLE
- @ 3, 0 SAY "╠═══════════════════════════════════════"
- @ 3,40 SAY "═══════════════════════════════════════╣"
- @ 2,col SAY menuhdg
- <<GenColor( 0,'PROMPT' )>>
- col = 34
- @ 5,col SAY "0. Quit"
- @ 6,col SAY "1. Append"
- @ 7,col SAY "2. Browse"
- @ 8,col SAY "3. Edit/View"
- @ 9,col SAY "4. Help"
- @ 10,col SAY "5. Labels"
- @ 11,col SAY "6. Pack"
- @ 12,col SAY "7. Report"
- @ 13,col SAY "8. Select "
- @ 16,33 SAY " select : : "
- @ 16,42 SAY ""
- * ---Allow either the number or the first letter of a menu item.
- SET INTENSITY OFF
- choice = "*"
- DO WHILE .NOT. (choice $ "012345678QABEHLPRS")
- choice = " "
- @ 16,42 GET choice PICTURE "!"
- READ
- ENDDO
- SET INTENSITY ON
- * ---Number becomes first letter of menu selection.
- IF choice $ "012345678"
- choice = SUBSTR( "QABEHLPRS",VAL( choice ) + 1,1 )
- ENDIF
- <<end GenMultiSimple>>
-
-
- <<procedure GenSingleSimple>>
- <<integer row>>
- <<begin>>
- PARAMETER choice
- PRIVATE col
- <<GenColor( 0,'SCREEN' )>>
- CLEAR
- * ---Center the menu heading.
- <<fname := ExpandName( menutitle )>>
- menuhdg = {"}{fname} M A I N M E N U{"}
- col = (80 - LEN(menuhdg)) / 2
- @ 1,0 TO 15,79 DOUBLE
- @ 3, 0 SAY "╠═══════════════════════════════════════"
- @ 3,40 SAY "═══════════════════════════════════════╣"
- @ 2,col SAY menuhdg
- <<GenColor( 0,'PROMPT' )>>
- col = 34
- @ 5,col SAY "0. Quit"
- @ 6,col SAY "1. Append"
- @ 7,col SAY "2. Browse"
- @ 8,col SAY "3. Edit/View"
- @ 9,col SAY "4. Help"
- @ 10,col SAY "5. Labels"
- @ 11,col SAY "6. Pack"
- @ 12,col SAY "7. Report"
- @ 15,33 SAY " select : : "
- @ 15,42 SAY ""
- * ---Allow either the number or the first letter of a menu item.
- SET INTENSITY OFF
- choice = "*"
- DO WHILE .NOT. (choice $ "01234567QABEHLPR")
- choice = " "
- @ 15,42 GET choice PICTURE "!"
- READ
- ENDDO
- SET INTENSITY ON
- * ---Number becomes first letter of menu selection.
- IF choice $ "01234567"
- choice = SUBSTR( "QABEHLPR",VAL( choice ) + 1,1 )
- ENDIF
- <<end GenSingleSimple>>
-
-
- <<#
- procedure GenSimpleMenu
- begin
- if ismultials
- GenMultiSimple
- else
- GenSingleSimple
- endif
- end GenSimpleMenu
-
- <<* EOF: APPMENU.INC *>>
- #>>