!*************************** AMUS Program Label ****************************** ! Filename: SEEHOT.RUN Date: 10/9/91 ! Category: Hash Code: 243-614-635-425 Version: 1.0(104) ! Initials: GR/AM Name: James A. Jarboe IV ! Company: Educational Video Network, Inc. Telephone #: 4092955767 ! Related Files: D/BASIC OR D/RUN, PSFMT.LIT ! Min. Op. Sys.: 1.3 Expertise Level: BEG ! Special: Runs with d/Softs d/BASIC or d/RUN and PSFMT.LIT ! Description: Allows user to display HOTKEY key names and the data associated ! with that key for all .HOT files. Also allows user to get a printed listing ! of HOTKEYs in regular text or postscript output files. !***************************************************************************** !*! Updated on 08-Oct-91 at 8:32 PM by James A. Jarboe I V; edit time: 3:55:15 !**************************************************************************** ! * ! SEEHOT.BAS - Display HOTKEY file information * ! * !**************************************************************************** ! Description: ! Displays HOTKEY key names and allows selection of key to display ! the HOTKEY information related to that key. A nifty way to see ! the entire contents of a .HOT file or print out a listing of HOTKEY ! Key Names. ! ! Derived from: ! HOTIDX.BAS - by Ami Bar-Yadin ! HOTDSP.BAS - by James J. Couball ! ! -NOTE- ! ! This program will NOT display the HOT Key data with RUN.LIT 1.2(161). ! You can see the HOTKEY display and Print out a listing if you use ! RUN.LIT 1.2(161) ! ! Must use RUN.LIT 1.3 (170) or greater for program to run complete. ! ! Syntax: ! ! RUN SEEHOT ; Presents menu to select from. ! RUN SEEHOT DBASIC ; Uses DBASIC.HOT ! RUN SEEHOT MACRO.HOT ; Uses MACRO.HOT ! ! This program was designed,implemented ! ! James A. Jarboe IV GR/AM ! Educational Video Network, Inc. ! 1401 19th Street ! Huntsville, TX 77340 ! 1-409-295-5767 ! ! Edit History: ! PROGRAM SEEHOT, 1.0(104) ! ! [104] 06-Oct-91 Added check for .FNK file via find.funkey macro. ! [103] 05-Oct-91 Added Print out routine ! [102] 01-Oct-91 Added Error routine. ! [101] 18-Sep-91 Added Macro files and PickList of files. ! [100] 20-Dec-89 Written - James A. Jarboe IV ! ! NOTE: Must run with d/RUN 1.3 or greater. ! Call d/SOFT at 1-717-629-7190 to get your update today! ! ! Additional files: ! ! STDMAC.MAC - d/BASIC Macro file. ! STDMAC.BSI - d/BASIC Macro variables. ! SEEHOT.HLP - Help file for SEEHOT.RUN ! ++include STDMAC ! Get variables and Macro file. ! ! Define maximum number of keys we can handle and length of key ! def max'n = 500 def max'l = 30 ! map1 HOTKEY'BLOCK, X, 512 ! Block of Key names. map1 HOTKEYS map2 NAMES(max'n), S, max'l ! List of ASCII HOT Key names. map1 DISPLAY, S, max'l ! String to get HOT Key name. map1 HOTKEY'RECORD map2 HOTKEY'KEY(64) ! HOTKEY KEY - 64 per block. map3 HOTKEY'IDX, S, 6 ! Hotkey key index. map3 HOTKEY'LNK, B, 2 ! Hotkey link to Keyname. map1 NUM'REC, F, 6 ! Number of HOT Keys. map1 FUN'KEY, F, 6 ! Pick.list function key value. map1 hotkey'ch, F, 6, 65200 ! HOTKEY channel number map1 print'ch, F, 6, 65201 ! Print channel number map1 result, F, 6 ! HOTKEY returned value. map1 file1, F, 6 ! Open file variable. map1 pick'depth, F, 6 ! Depth of pick list files. map1 op'flag, F, 6, .false ! Option flag. map1 answer, F, 6 ! File lookup returned value. map1 printer'name, S, 6 ! Printer name. map1 print'type(2), S, 12 print'type(1) = "Regular" print'type(2) = "Postscript" map1 pt'f, B, 4 map1 print'select, F, 6 ! Selected print type map1 print'to, S, 10 ! Output file name. map1 screen'cur, F, 6, 1 ! Current screen display. map1 screen'last, F, 6 ! Total number of screens. map1 orig'width, F, 6 ! Original terminal width. ! Define maximum file names. ! def max'f = 50 ! map1 file'names(max'f), S, 30 ! HOTKEY file names buffer. map1 file'select, F, 6 ! Selected file name. map1 x$, S, 132 ! Misc string. ! Define some screen constants. ! def start'row=5 def max'rows=18 def column'width=20 map1 position, F, 6 ! Used to set key display per screen. map1 saved'keyword, F, 6 ! Saved current key number to display. map1 current'keyword, F, 6 ! Current keyword cursor is on. map1 keyword'at'top, F, 6 ! First keyword number per screen. map1 row, F, 6 ! Print row. map1 col, F, 6 ! Print column. map1 max'cols,f,6,int(.width/column'width) float num, ans, d, page'no, a,page'next,p'start,print'flag !!!!!!!!!!!!!!!!! ! Program Start ! !!!!!!!!!!!!!!!!! ! log.errors on error goto ERR'ROUTINE ! !! Set up screen and get .options ! find.funkey init.term i = 0 orig'width = .width reset uplowcase file'names(1) = .options when file'names(1) <> "" file'names(1) = filespec(file'names(1),"HOT") when file'names(1) = "" call DISPLAY'HEADER display.error "Invalid File Specification was Entered" goto FIND'FILES wend file'select = 1 op'flag = .true goto PICK'SKIP wend call DISPLAY'HEADER ! !! Load Directory of File names. ! FIND'FILES: op'flag = .false dual.print tab(5,1);center("Looking for _HOTKEY_ files.",.width-2); get.dir of "*.HOT" from "HLP:" into file'names(macro'x) array max'f if error'occured goto DONE for x = 1 to macro'x file'names(x)="HLP:"+file'names(x) next x x = macro'x macro'x+=1 x$ = "["+.account+"]" get.dir of "*.HOT" from x$ into file'names(macro'x) array max'f at macro'x if error'occured or macro'x = 0 goto DONE when macro'x > x for i = x+1 to macro'x file'names(i)=.device+file'names(i)+"["+.account+"]" next i wend pick'depth = macro'x if pick'depth > 10 pick'depth = 10 ! !! Select a HOTKEY file. ! PICK'START: HOTKEYS = NULL(max'n*40) NUM'REC = 0 call PICK'HOTFILE when file'select = 0 or file'select = 65535 goto DONE wend ! !! Open HOT file, Get HOT Keys and sort them. ! PICK'SKIP: lookup file'names(file'select), answer when answer > -1 call DISPLAY'HEADER x$=file'names(file'select) switch on answer case 0 : x$+=" does NOT exist" : endcase default case : x$+=" is NOT a RANDOM file" : endcase endswitch display.error x$ goto FIND'FILES wend open #hotkey'ch,file'names(file'select),RANDOM'FORCED,512,file1 call READ'HOTKEY'FILE CLOSE #hotkey'ch sort.memory NUM'REC records of NAMES(1) using NAMES(1) ascending call PICK'HOTKEY if op'flag = .true goto DONE call DISPLAY'HEADER goto PICK'START ! !! Select a HOTKEY name to display. ! PICK'HOTKEY: open #hotkey'ch, file'names(file'select), hotkey keyword'at'top = 1 current'keyword = 1 if .keypress x = getkey(-1) ! !! Pick a HOT Key. ! PICK'SCREEN: call display'a'page'of'keywords call highlight'current'keyword reset echo set image do a = getkey(-1) until a='ESCAPE' or a = '^C' switch on a case '^J' : call down'arrow : endcase case 9 : call down'arrow : endcase case '^E' : call end'key : endcase case 13 : call DISPLAY'EM : endcase case 'EXECUTE' : call DISPLAY'EM : endcase case 'HOME' : call home : endcase case '^H' : call left'arrow : endcase case 'NEXT PAGE' : call next'page : endcase case '^T' : call next'page : endcase case 'PREV PAGE' : call prev'page : endcase case '^R' : call prev'page : endcase case '^L' : call right'arrow : endcase case 168 : call right'arrow : endcase case 169 : call left'arrow : endcase case 'HELP' : call HELP'EM : endcase case 'F8' : call HELP'EM : endcase case 'PRINT' : call PRINT'MENU : endcase case '^K' : call up'arrow : endcase case 'F1' : call toggle'screen : endcase endswitch enddo set echo reset image close #hotkey'ch return ! !! Display HOT key information. ! DISPLAY'EM: hotkey #hotkey'ch, rtrim(NAMES(current'keyword)), result if result=0 call TOPIC'NOT'THERE ? tab(-1,0); call DISPLAY'BANNER call display'a'page'of'keywords call highlight'current'keyword return ! !! Ooops..Topic not there. ! TOPIC'NOT'THERE: display.error "No data Found for "+rtrim(NAMES(current'keyword)) reset echo set image return ! !! Read Hot Key file to get Key names. ! READ'HOTKEY'FILE: ? tab(4,1);tab(-1,10); call DISPLAY'BANNER i = 0 file1=0 NUM'REC = 0 read #hotkey'ch,HOTKEY'RECORD do i+=1 until i>64 if HOTKEY'LNK(i) = 0 break call READ'HOTKEY'DATA call STAR enddo screen'last = int(NUM'REC/(max'cols*max'rows))+1 screen'cur = 1 call DISPLAY'SCREEN'NO return ! !! Read a block of Key names. ! READ'HOTKEY'DATA: x = 1 file1 = HOTKEY'LNK(i) read #hotkey'ch, HOTKEY'BLOCK repeat DISPLAY = HOTKEY'BLOCK[x;25] num=len(DISPLAY) if num = 0 break NUM'REC+=1 NAMES(NUM'REC)=rtrim(DISPLAY) NAMES(NUM'REC)=ljust(NAMES(NUM'REC),max'l) num+=1 x+=num+(num mod 2)+4 until 0 return ! !! Show status. ! STAR: dual.print tab(2,10)"_"+str(NUM'REC)+"_"; return ! !! Select HOTKEY file to READ. ! PICK'HOTFILE: reset funkey if .keypress x = getkey(-1) ? TAB(4,1);tab(-1,10); x =(.width/2)-17 dual.print tab(pick'depth+10,1);center(" Move Cursor _UP_ or _DOWN_ to SELECT File. ",.width+6) dual.print tab(pick'depth+11,1);center("Press _RETURN_ to PROCESS File.",.width+2) dual.print tab(pick'depth+12,1);center("Press _ESCAPE_ to EXIT.",.width+2) pick.list into file'select,.true title "Select HOTKEY File to Display" located at 5,x depth pick'depth text array file'names(1) special key variable FUN'KEY end picklist set funkey return ! !! Display screen header. ! DISPLAY'HEADER: dsoft.header .companyname, "Display HOTKEY Information", "d/Freeware" return ! !! Display Screen Banner. ! DISPLAY'BANNER: ? TAB(-1,0); banner "HOTKEY Descriptions" ? TAB(-1,29); x$="p2,2d|r`-"+str(.width-4)+"u'|" draw.form x$ dual.print tab(2,3);center("_"+file'names(file'select)+"_",.width-2); dual.print tab(2,3);" Keys: _";str(NUM'REC); call DISPLAY'SCREEN'NO return ! !! Display current screen number and number of screens we can display. ! DISPLAY'SCREEN'NO: if screen'last = 0 return dual.print tab(2,.width-17);"Screen _"+str(screen'cur)+"_ of _"+str(screen'last)+"_"; return ! !! Give user some help. ! HELP'EM: rundos "HELP "+.pgmname+"/P" ? TAB(-1,0); call DISPLAY'BANNER call display'a'page'of'keywords call highlight'current'keyword return ! !! Let user pick printer and print type. ! PRINT'MENU: ? tab(4,1);tab(-1,10); if print'flag = .false call PICK'PRINT when print'select = 0 or print'select = 65535 print'flag = .false goto END'PRINT wend x$ = .jobnumber using "#ZZ" print'to = .jobname+"."+x$ open #print'ch, print'to, output x$ = "Printing _"+rtrim(print'type(print'select))+" text_ to _" when printer'name = "" x$+="default printer" else x$+=ucs(printer'name) wend x$+="_." dual.print tab(4,1);center(x$,.width+4); page'no = int(NUM'REC/(54*4)) page'no+=1 d = 0 x = int((NUM'REC/4)+.9) when x>54 page'next =x-54 x = 54 wend when print'select = 2 call PS'1 ? #print'ch else ? #print'ch ? #print'ch,center(file'names(file'select)+" Listing",80) ? #print'ch wend for a= 1 to page'no when a > 1 ? #print'ch ? #print'ch, ljust(file'names(file'select),30); ? #print'ch, rjust("Page "+str(a)+" of "+str(page'no),50) ? #print'ch : ? #print'ch wend for i = 1 to x ? #print'ch, ljust(NAMES(i+d),20); ? #print'ch,ljust(NAMES(i+x+d),20); ? #print'ch,ljust(NAMES(i+(x*2)+d),20); ? #print'ch,ljust(NAMES(i+(x*3)+d),20); when print'select = 2 ? #print'ch,ljust(NAMES(i+(x*4)+d),20); ? #print'ch,ljust(NAMES(i+(x*5)+d),20); ? #print'ch,ljust(NAMES(i+(x*6)+d),20); wend ? #print'ch,"" next i when a <> page'no p'start = 1 x = page'next d = 4*54 ? #print'ch, chr$(12) wend next a ? #print'ch ? #print'ch "Total of "+plural("HOT Key",NUM'REC)+"." ? #print'ch chr$(12) close #print'ch when print'select = 2 reset ctrlcok rundos "PSFMT "+print'to kill print'to print'to = .jobname+".LST" set ctrlcok call DISPLAY'BANNER wend xcall spool, print'to,printer'name,(2^2) END'PRINT: ? tab(4,1);tab(-1,10); call display'a'page'of'keywords call highlight'current'keyword return ! !! Pick a printer. ! PICK'PRINT: reset image set echo x = (.width/2)-13 drawbox 7, x, 3, 25 x+=1 ? tab(8,x);tab(-1,12);tab(-1,28);:Input " Printer Name: ",printer'name ? tab(-1,29); dual.print tab(13+4,1);center("Press _RETURN_ or _EXECUTE_ to PRINT. ",.width+2) dual.print tab(13+5,1);center("Press _ESCAPE_ to ABORT Printing. ",.width) pick.list into print'select title "Select Printer Type" text array print'type(1) located at 10, x-1 window size 25 depth 2 end picklist print'flag = .true set image reset echo return ! !! Pre-Postscript output for PSFMT. ! PS'1: ? #print'ch,".landscape" ? #print'ch,".font 1 = courier" ? #print'ch,".font size 8.5" ? #print'ch,".noscale" ? #print'ch,".nowrap ? #print'ch,".notick" ? #print'ch,".tm .74"+chr$(34) ? #print'ch,".bm .5"+chr$(34) ? #print'ch,".background" ? #print'ch,"/CEN {moveto dup stringwidth 2 div neg exch 2 div neg exch} def" ? #print'ch,"0 setgray" ? #print'ch,"/Helvetica findfont 9 scalefont setfont ("; x$ = .date using "#ZZZZZ" ? #print'ch,file'names(file'select)+" printed on "+x$[3;2]+"-"+.month[1,3]+"-19"+x$[5;2]; ? #print'ch " by "+.username+") 5.50 inch .31 inch CEN rmoveto show" ? #print'ch,"0.3 inch 7.85 inch moveto ? #print'ch,"/Helvetica-Bold findfont 20 scalefont setfont("; ? #print'ch,file'names(file'select)+" Listing) 5.50 inch 7.85 inch CEN rmoveto show" ? #print'ch,"0.3 inch 7.8 inch moveto" ? #print'ch,"20.20 35.20 translate 1.00 setlinewidth" ? #print'ch,"0 06.00 moveto" ? #print'ch,"0 523.60 745.80 523.60 06.00 arcto pop4" ? #print'ch,"745.80 523.60 745.80 0 06.00 arcto pop4" ? #print'ch,"745.80 0 0 0 06.00 arcto pop4" ? #print'ch,"0 0 0 523.60 06.00 arcto pop4" ? #print'ch,"stroke" ? #print'ch,".end background" page'no = 1 x = int((NUM'REC/7)+.9) return ! Finished. ! DONE: when orig'width <> .width ? tab(-1,0);tab(-1,36); switch on orig'width case 80 : ? tab(-1,81); : endcase default case : ? tab(-1,80); : endcase endswitch ? tab(-1,37); wend init.term end ! !! Error routine. ! ERR'ROUTINE: if err(0)=1 goto DONE wipebox 6, (.width/2-25)-1, 17, 52 drawbox 7, (.width/2)-25, 15, 50 x = (.width/2)-25 x$="_ d/BASIC Program Error _" ? tab(7,(.width/2)+(len(x$)/2)+1);tab(-1,33); dual.print tab(7,(.width/2)-(len(x$)/2)+2);tab(-1,32);x$;tab(-1,33); dual.print tab(9,x+1);center("Basic Error #_"+str(err(0)),50); x$ = "_"+errmsg$(err(0))+"_" ? tab(11,x+1+len(x$));tab(-1,22); dual.print tab(11,x+1);tab(-1,21);center("_"+errmsg$(err(0))+"_",50);tab(-1,22); dual.print tab(13,x+1)center("has occured in _"+.pgmname+".RUN",50); x$ = "" if err(1)> 0 then x$ = "At line #_"+str(err(1))+" _" x$ = x$+"On Channel #_"+str(err(2)) dual.print tab(15,x+1);center(x$,50); x$ = "At Address #_"+str(err(5)) if err(3)> 0 then x$+="_ JOBERR Value #_"+str(err(3)) dual.print tab(17,x+1);center(x$,50); if .keypress then x = getkey(-1) display.error "Contact System Operator" wipebox 6, (.width/2-25)-1, 17, 52 goto DONE ! !! Reverse Highlight the current key word. ! highlight'current'keyword: call get'row'col print tab(row,col+column'width-1); tab(-1,33); print tab(row,col);tab(-1,32); dual.print "_ "+NAMES(current'keyword)[1,17]+"_";tab(-1,33); return unhighlight'current'keyword: call get'row'col dual.print tab(row,col);" "+NAMES(current'keyword)[1,17]+" "; return display'a'page'of'keywords: saved'keyword = current'keyword for current'keyword=keyword'at'top to ((keyword'at'top+max'rows*max'cols-1) min NUM'REC) call get'row'col print tab(row,col); if keyword'at'top=current'keyword then print tab(-1,10); print " ";NAMES(current'keyword)[1,column'width-3]; next current'keyword current'keyword = saved'keyword dual.print tab(.length,1);center("Press _HELP_ for HELP, Press _PRINT_ to PRINT",.width+4); return down'arrow: call unhighlight'current'keyword when current'keyword=((keyword'at'top+max'rows*max'cols-1) min NUM'REC) current'keyword = keyword'at'top goto next'page else current'keyword += 1 wend call highlight'current'keyword return up'arrow: call unhighlight'current'keyword when current'keyword=keyword'at'top current'keyword = (keyword'at'top+max'rows*max'cols-1) min NUM'REC goto prev'page else current'keyword -= 1 wend call highlight'current'keyword return right'arrow: call unhighlight'current'keyword when current'keyword+max'rows>((keyword'at'top+max'rows*max'cols-1) min NUM'REC) while current'keyword-keyword'at'top>=max'rows current'keyword -= max'rows wend else current'keyword += max'rows wend call highlight'current'keyword return left'arrow: call unhighlight'current'keyword when current'keyword-max'rowsmax'rows current'keyword += max'rows wend else current'keyword -= max'rows wend call highlight'current'keyword return home: call unhighlight'current'keyword when keyword'at'top=current'keyword when keyword'at'top <> 1 keyword'at'top = 1 screen'cur = 1 call DISPLAY'SCREEN'NO call display'a'page'of'keywords wend current'keyword = 1 else current'keyword = keyword'at'top wend call highlight'current'keyword return prev'page: when NUM'REC>max'rows*max'cols-1 current'keyword -= max'rows*max'cols keyword'at'top -= max'rows*max'cols screen'cur-=1 when keyword'at'top<1 repeat current'keyword += max'rows*max'cols keyword'at'top += max'rows*max'cols until keyword'at'top+max'rows*max'cols-1>NUM'REC when current'keyword>NUM'REC current'keyword = NUM'REC wend screen'cur = screen'last wend call DISPLAY'SCREEN'NO call display'a'page'of'keywords wend call highlight'current'keyword return next'page: when NUM'REC>max'rows*max'cols-1 current'keyword += max'rows*max'cols keyword'at'top += max'rows*max'cols screen'cur+=1 when keyword'at'top>NUM'REC while keyword'at'top>max'rows*max'cols-1 keyword'at'top -= max'rows*max'cols current'keyword -= max'rows*max'cols wend screen'cur = 1 else when current'keyword>NUM'REC current'keyword = NUM'REC wend wend call DISPLAY'SCREEN'NO call display'a'page'of'keywords wend call highlight'current'keyword return end'key: call unhighlight'current'keyword when current'keyword<((keyword'at'top+max'rows*max'cols-1) min NUM'REC) current'keyword = ((keyword'at'top+max'rows*max'cols-1) min NUM'REC) else when NUM'REC-keyword'at'top>max'rows*max'cols-1 while NUM'REC-keyword'at'top>max'rows*max'cols-1 keyword'at'top += max'rows*max'cols wend current'keyword = NUM'REC screen'cur = screen'last call DISPLAY'SCREEN'NO call display'a'page'of'keywords wend wend call highlight'current'keyword return toggle'screen: ? tab(-1,0);tab(-1,36); switch on .width case 80 print tab(-1,80); sleep 2500 endcase case 132 print tab(-1,81); sleep 2500 endcase endswitch keyword'at'top = 1 current'keyword = 1 max'cols = int(.width/column'width) screen'last = int(NUM'REC/(max'cols*max'rows))+1 screen'cur = 1 call DISPLAY'BANNER call display'a'page'of'keywords ? tab(-1,37); call highlight'current'keyword return get'row'col: position = current'keyword-keyword'at'top row = ((position mod max'rows)+start'row) using "###" col = (int(position/max'rows)*column'width+1) using "###" return