SUB ZeeView (View$(), ZRow%, ULR%, ULC%, LRR%, LRC%, ZVColrFG%, ZVColrBG%, ZeeCount%, LeaveCode%, Box1%, ShowLine%) ' +--------------------------------------------------------------------+ ' | - S U B Z e e V i e w - | ' | | ' | Public Domain - FreeWare | ' +--------------------------------------------------------------------+ ' | Author: Donald B. "Don" Smith | ' | Email : smithdonb@earthlink.net | ' | Date: 05/01/2002 | ' +--------------------------------------------------------------------+ ' | - ABOUT THE AUTHOR - | ' +--------------------------------------------------------------------+ ' | | ' | Hello. My name is Don Smith and I am a thirty-year retired teacher | ' | of Math/History/Spanish residing in Orange County, California. I | ' | am also a former six-year Sergeant of Marines. Who-Rah! On certain | ' | forums I am known as MarineDon.My email is: smithdonb@earthlink.net| ' | | ' +--------------------------------------------------------------------+ ' | - COPYING AND DISTIBUTING - | ' +--------------------------------------------------------------------+ ' | Since this code is public domain and freeware, anyone may freely | ' | copy and distribute it. If you use the QuickBasic code in one of | ' | your own programs, you do not have to cite my name as the author, | ' | and you may even change its name. | ' +--------------------------------------------------------------------+ ' +----------------------SUB ZeeView-----------------------------------+ ' | ZeeView actually is an ASCII file browser, and it could very well | ' | by modified to work as one. ZeeView was written by Don Smith | ' | on May 1, 2002 and it is declared to be Public Domain, FreeWare. | ' | EMail: smithdonb@earthlink.net | ' +--------------------------------------------------------------------+ ' +--------------------------------------------------------------------+ ' | View$() | View$ are the strings to view. This must be set up | ' | | in the main program by using DIM or REDIM, opening | ' | | a file and reading the lines. Refer to ViewPort.Doc | ' +------------+-------------------------------------------------------+ ' | ZRow% | Same as ULR% (Upper Left Row) | ' +------------+-------------------------------------------------------+ ' | ULR% | Upper left row to place print on screen | ' +------------+-------------------------------------------------------+ ' | ULC% | Upper left column to place print on screen | ' +------------+-------------------------------------------------------+ ' | LRR% | Lower right row to place print on screen | ' +------------+-------------------------------------------------------+ ' | LRC% | Lower right column to place print on screen | ' +------------+-------------------------------------------------------+ ' | ZVColrFG% | Color of foreground of text to print on screen | ' +------------+-------------------------------------------------------+ ' | ZVColrBG% | Color of back ground of text to print on screen | ' +------------+-------------------------------------------------------+ ' | ZeeCount% | Total lines to view | ' +------------+-------------------------------------------------------+ ' | LeaveCode% | Exits program set to a number. | ' | | LeaveCode = 1 if or is pressed. | ' | | LeaveCode% = 27 if is pressed. | ' | | LeaveCode% = 20 if is pressed. | ' | | LeaveCode% = 25 if is pressed. | ' +------------+-------------------------------------------------------+ Box2% = 77 - (Box1% + 3) Box2% = Box2% - 2 Show% = ShowLine% ShowShow% = ShowLine% begin.zeeshow: COLOR ZVColrFG%, ZVColrBG% FOR ZeeShow% = ULR% TO LRR% IF Show% = ZeeCount% THEN EXIT FOR END IF COLOR ZVColrFG%, ZVColrBG% LOCATE ZRow%, ULC% PRINT SPACE$(LRC% - ULC% + 3) LOCATE ZRow%, ULC% 'PRINT View$(show%) PRINT LEFT$(View$(Show%), Box2%) ZRow% = ZRow% + 1 Show% = Show% + 1 IF Show% - 14 > 1 THEN TopCount% = Show% - 15 BottCount% = Show% - 1 ELSEIF Show% - 14 < 1 THEN TopCount% = 1 BottCount% = 15 END IF COLOR 0, 7 LOCATE 8, Box1% + 6 PRINT "Top Line:"; LOCATE 8, Box1% + 15 PRINT STR$(TopCount%) + " "; LOCATE 24, Box1% + 6 PRINT "Bottom Line:"; LOCATE 24, Box1% + 18 PRINT STR$(BottCount%) + " "; NEXT DO DO HitKey$ = INKEY$ LOOP UNTIL LEN(HitKey$) > 0 HitKey% = CVI(HitKey$ + CHR$(0)) IF HitKey% = 20480 THEN ' IF ShowShow% + 15 < ZeeCount% THEN ShowShow% = ShowShow% + 1 END IF Show% = ShowShow% ZRow% = ULR% GOTO begin.zeeshow ELSEIF HitKey% = 18432 THEN ' IF ShowShow% > 1 THEN ShowShow% = ShowShow% - 1 END IF Show% = ShowShow% ZRow% = ULR% GOTO begin.zeeshow ELSEIF HitKey% = 20736 THEN ' IF ShowShow% < (ZeeCount% + 1) - (LRR% - ULR% + 1) THEN ShowShow% = ShowShow% + (LRR% - ULR% + 1) END IF Show% = ShowShow% ZRow% = ULR% COLOR ZVColrFG%, ZVColrBG% FOR CleanOut% = ULR% TO LRR% LOCATE CleanOut%, ULC% PRINT SPACE$(LRC% - ULC% + 3); NEXT GOTO begin.zeeshow ELSEIF HitKey% = 18688 THEN ' IF ShowShow% > (LRR% - ULR% + 1) THEN ShowShow% = ShowShow% - (LRR% - ULR% + 1) END IF IF ShowShow% <= LRR% - ULR% + 1 THEN ShowShow% = 1 END IF Show% = ShowShow% ZRow% = ULR% COLOR ZVColrFG%, ZVColrBG% FOR CleanOut% = ULR% TO LRR% LOCATE CleanOut%, ULC% PRINT SPACE$(LRC% - ULC% + 3); NEXT GOTO begin.zeeshow ELSEIF HitKey% = 18176 THEN ' Show% = 1 ShowShow% = Show% ZRow% = ULR% GOTO begin.zeeshow ELSEIF HitKey% = 20224 THEN ' Show% = ZeeCount% - (LRR% - ULR% + 1) ShowShow% = Show% ZRow% = ULR% GOTO begin.zeeshow ELSEIF HitKey% = 9 OR HitKey% = 19200 THEN ' or 'with LeaveCode% set to 1, then pressed Tab or Left Arrow LeaveCode% = 1 IF Show% - 15 > 0 THEN ShowLine% = Show% - 15 ELSE ShowLine% = 1 END IF EXIT SUB ELSEIF HitKey% = 15104 THEN ' LeaveCode% = 20 ShowLine% = ShowShow% EXIT SUB ELSEIF HitKey% = 16128 THEN ' IF LeaveCode% = 2 THEN ShowLine% = ShowShow% LeaveCode% = 25 EXIT SUB END IF ELSEIF HitKey% = 27 THEN LeaveCode% = 27 EXIT SUB END IF LOOP END SUB