home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
ptcmenu.zip
/
PTCMENU.CLA
< prev
next >
Wrap
Text File
|
1990-02-27
|
11KB
|
260 lines
PTCMENU PROGRAM
!===============================================================================
! This is a simplified example of our System Menu that we use for our clients. !
! The GODOS procedure (DOS1.BIN) is used to set a DOS Error Level Code, then !
! quick exit. When used in conjunction with a Batch File (see MENU.BAT), the !
! ERRORLEVEL Code can be used to do conditional branching. The advantages of !
! of this technique are: !
! * No RAM overhead, PTCMENU unloads and reloads between menu selections. !
! * Much faster than using the RUN command!!! !
! * TSRs can be conditionally loaded from the controlling Batch File. !
! NOTE: This example requires the referenced Clarion files be in the PATH. !
! After compiling and translating PTCMENU, run MENU.BAT for the demonstration.!
!------------------------------------------------------------------------------!
! Randy Goodhew !
! PROFESSIONAL TECHNOLOGIES CONSULTANTS !
! 508 Greenup Street !
! Covington, Kentucky 41011 !
! Phone:(606) 491-3020 !
! FAX and Modem Available. !
!===============================================================================
ESC_KEY EQUATE(256)
CTRL_ESC EQUATE(279)
MAP
PROC(SHOW_STATUS)
PROC(FX_IMPLODE)
MODULE('DOS1.BIN'),BINARY !! DOS1.BIN LEM is required
PROC(GODOS)
FUNC(ENVIRONMENT),STRING
. .
!----------- Configuration File --------------------------
PTCMENU FILE,PRE(PTC)
OWNER('ROSEBUD'),ENCRYPT
RECORD RECORD
MenuItem STRING(30)
. .
!----------- Menu Screen -----------------------------------
MENU_SCREEN SCREEN PRE(SCR),HUE(7,0)
ROW(1,1) STRING('<201,205{11},209,205{14},187>'),ENH
ROW(2,1) REPEAT(3);STRING('<186,0{11},179,0{14},186>'),ENH .
ROW(5,1) STRING('<200,205{11},207,205{14},188>'),ENH
ROW(1,29) STRING('<201,205{50},187>'),HUE(15,1)
ROW(2,29) REPEAT(3);STRING('<186,0{50},186>'),HUE(15,1) .
ROW(5,29) STRING('<200,205{50},188>'),HUE(15,1)
ROW(2,3) STRING('<201,205,203,205,203,205,203,205,184>') |
HUE(4,7)
ROW(3,3) STRING('<204,205,188,0,186,0,186>'),HUE(4,7)
ROW(4,3) STRING('<208,0{3},208,0,200,205,190>'),HUE(4,7)
ROW(6,1) REPEAT(2);STRING('<177{80}>') .
ROW(8,1) STRING('<177{5},0{69},177{6}>')
ROW(9,1) REPEAT(13);STRING('<177{5},0{71},177{4}>') .
ROW(22,1) STRING('<177{7},0{69},177{4}>')
ROW(23,1) REPEAT(2);STRING('<177{80}>') .
ROW(8,6) STRING('<201,181,0{11},198,205{20},209,205{33},187>')|
HUE(0,6)
ROW(9,6) REPEAT(12)
STRING('<186,0{33},179,0{33},186>'),HUE(0,6) .
ROW(21,6) STRING('<200,205{33},207,205{33},188>'),HUE(0,6)
ROW(2,2) STRING(' '),HUE(4,7)
COL(12) STRING(' '),HUE(4,7)
COL(14) STRING(' PROFESSIONAL '),HUE(15,4)
COL(30) STRING(' {50}'),HUE(14,1)
ROW(3,2) STRING(' '),HUE(4,7)
COL(6) STRING(' '),HUE(4,7)
COL(8) STRING(' '),HUE(4,7)
COL(10) STRING(' '),HUE(4,7)
COL(14) STRING(' TECHNOLOGIES '),HUE(1,7)
COL(30) STRING(' {15}ptcMENU Demonstration {14}'),HUE(14,1)
ROW(4,2) STRING(' '),HUE(4,7)
COL(4) STRING(' '),HUE(4,7)
COL(8) STRING(' '),HUE(4,7)
COL(12) STRING(' '),HUE(4,7)
COL(14) STRING(' CONSULTANTS '),HUE(15,1)
COL(30) STRING(' {50}'),HUE(14,1)
ROW(8,8) STRING(' Main Menu '),HUE(0,6)
ROW(9,7) STRING(' '),HUE(0,6)
COL(8) STRING(' {32}'),HUE(1,7)
COL(41) STRING(' {32}'),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(10,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(11,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(12,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(13,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(14,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(15,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(16,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(17,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(18,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(19,7) STRING(' '),HUE(0,6)
COL(8) STRING(' '),HUE(1,7)
COL(39) STRING(' '),HUE(1,7)
COL(41) STRING(' '),HUE(1,7)
COL(72) STRING(' '),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(20,7) STRING(' '),HUE(0,6)
COL(8) STRING(' {32}'),HUE(1,7)
COL(41) STRING(' {32}'),HUE(1,7)
COL(73) STRING(' '),HUE(0,6)
ROW(25,1) STRING(' {80}'),HUE(1,7)
ROW(10,11) MENU,USE(?MENU_FIELD),REQ
MENU_01 COL(9) STRING(30),HUE(1,7),SEL(15,1)
MENU_02 ROW(11,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_03 ROW(12,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_04 ROW(13,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_05 ROW(14,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_06 ROW(15,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_07 ROW(16,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_08 ROW(17,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_09 ROW(18,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_10 ROW(19,9) STRING(30),HUE(1,7),SEL(15,1)
MENU_11 ROW(10,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_12 ROW(11,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_13 ROW(12,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_14 ROW(13,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_15 ROW(14,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_16 ROW(15,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_17 ROW(16,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_18 ROW(17,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_19 ROW(18,42) STRING(30),HUE(1,7),SEL(15,1)
MENU_20 ROW(19,42) STRING(30),HUE(1,7),SEL(15,1)
. .
!----------- Code Starts Here ------------------------------
CODE
OPEN(Menu_Screen)
SETCURSOR
OPEN(PTCMENU) !OPEN Menu Configuration File,
IF ERROR() THEN STOP(ERROR()). ! Use SHARE if Network.
GET(PTCMENU,1) ; SCR:MENU_01 = PTC:MenuItem !Load Menu Item Descriptions.
GET(PTCMENU,2) ; SCR:MENU_02 = PTC:MenuItem !This repetitive operation can
GET(PTCMENU,3) ; SCR:MENU_03 = PTC:MenuItem !be simplified with a GROUP,
GET(PTCMENU,4) ; SCR:MENU_04 = PTC:MenuItem !ARRAY, REPEAT approach.
GET(PTCMENU,5) ; SCR:MENU_05 = PTC:MenuItem !However, for the sake of
GET(PTCMENU,6) ; SCR:MENU_06 = PTC:MenuItem !example and simplicity, this
GET(PTCMENU,7) ; SCR:MENU_07 = PTC:MenuItem !method works well.
GET(PTCMENU,8) ; SCR:MENU_08 = PTC:MenuItem !NOTE: Because of the ABSOLUTE
GET(PTCMENU,9) ; SCR:MENU_09 = PTC:MenuItem !record GETs, be sure there
GET(PTCMENU,10) ; SCR:MENU_10 = PTC:MenuItem !are exactly 20 records and no
GET(PTCMENU,11) ; SCR:MENU_11 = PTC:MenuItem !DELETEs in the PTCMENU file.
GET(PTCMENU,12) ; SCR:MENU_12 = PTC:MenuItem !Use the Scanner Utility to
GET(PTCMENU,13) ; SCR:MENU_13 = PTC:MenuItem !create and modify the records.
GET(PTCMENU,14) ; SCR:MENU_14 = PTC:MenuItem
GET(PTCMENU,15) ; SCR:MENU_15 = PTC:MenuItem
GET(PTCMENU,16) ; SCR:MENU_16 = PTC:MenuItem
GET(PTCMENU,17) ; SCR:MENU_17 = PTC:MenuItem
GET(PTCMENU,18) ; SCR:MENU_18 = PTC:MenuItem
GET(PTCMENU,19) ; SCR:MENU_19 = PTC:MenuItem
GET(PTCMENU,20) ; SCR:MENU_20 = PTC:MenuItem
CLOSE(PTCMENU)
IF ERROR() THEN STOP(ERROR()).
IDLE(Show_Status,0) !Display Date and Time
ALERT
ALERT(CTRL_ESC)
ALERT(ESC_KEY)
ACCEPT !Read choice
IF KEYCODE() = CTRL_ESC OR | !Screen ALERT keys
KEYCODE() = ESC_KEY
SETHUE(7,0,0)
BLANK
GODOS(0) !Set ERRORLEVEL = 0 and Exit
. !if
FX_IMPLODE(0,0,0) !Special Screen Effect
SETHUE(7,0,0)
BLANK
BLINK
SHOW(12,23,'Please Wait . . . Loading Program.')
NORMAL
LOOP WHILE KEYBOARD() !Clear Keyboard Buffer
ASK
. !loop
GODOS(CHOICE()) !Set DOS ERRORLEVEL to CHOICE()
!===========================================================
!----------- IDLE Procedure for Date and Time --------------
Show_Status PROCEDURE
CODE
SHOW(25,2,TODAY(),@D4)
SHOW(25,73,CLOCK(),@T3)
SHOW(25,38,ENVIRONMENT('SYS=')) !See explanation below.
! The above line will SHOW the Environment Variable called "SYS". I usually
! include a line in the AUTOEXEC.BAT, such as "SET SYS=STATION1". This helps
! identify different workstations on a network, by looking at the Menu Screen
! Status line.
!----------- Special Screen Effect -------------------------
FX_Implode PROCEDURE(fg,bg,border)
fg LONG
bg LONG
border LONG
row1 LONG
row2 LONG
col1 LONG
col2 LONG
CODE
SETHUE(fg,bg,border)
row1 = 1
row2 = 25
col1 = 1
col2 = 80
LOOP 13 TIMES
COLOR(row1,1,1,80)
COLOR(row2,1,1,80)
COLOR(1,col1,25,3)
COLOR(1,col2,25,3)
col1 += 3
col2 -= 3
row1 += 1
row2 -= 1
BEEP(0,8) !TIMING DELAY = 8/100 SECOND
END !loop