home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
busi
/
ncref20.zip
/
NCREF20.MOD
< prev
Wrap
Text File
|
1989-11-30
|
19KB
|
394 lines
MODULE NCREF20; (* JPI TopSpeed Modula-2 V1.16 - Ron Buelow 11/89 *)
IMPORT Lib, SYSTEM;
FROM IO IMPORT KeyPressed, RdKey, WrChar, WrCharRep, WrLn, WrStr;
FROM Window IMPORT Black, Blue, Cyan, LightCyan, LightGray, White,
Clear, Close, DoubleFrame, GotoXY, Hide, Info, Open,
PutOnTop, SetWrap, TextColor, TextBackground, Use,
WinType, WinDef;
VAR NCWin, MWin : WinType;
ch : CHAR;
i : CARDINAL;
PROCEDURE OpenWindows;
BEGIN
MWin := Open(WinDef(54,16,76,22,White,Blue,
FALSE,FALSE,TRUE,TRUE,DoubleFrame,White,Blue));
GotoXY(2,3);
WrStr("L Lotus 123 2.01");
GotoXY(2,4);
WrStr("W WordPerfect 5.0");
GotoXY(6,0);
WrStr(" User Menu ");
GotoXY(2,2);
WrStr("1 ");
TextColor(LightGray);
TextBackground(Black);
WrStr(" LoanPak 1.2 ");
NCWin := Open(WinDef(0,0,80,25,LightCyan,Black,
FALSE,FALSE,FALSE,TRUE,DoubleFrame,LightCyan,Black));
GotoXY(32,0);
WrStr(" NC V2.0 Qk Ref ");
Use(NCWin)
END OpenWindows;
PROCEDURE Page1;
BEGIN
GotoXY(1,2);
WrStr(" F1 Help Screen │ Ctrl-F1 Left Panel On/Off │ Alt-F1 Left Panel Drive ");
WrStr(" F2 User Menu │ Ctrl-F2 Right Panel On/Off │ Alt-F2 Rght Panel Drive ");
WrStr(" F3 View File │ Shift-F3 View Selected File │ Alt-F3 View File"); WrLn;
WrStr(" F4 Edit File │ Shift-F4 Edit Selected File │"); WrLn;
WrStr(" F5 Copy File │ Shift-F5 Copy Selected File │"); WrLn;
WrStr(" F6 Rename/Move │ Shift-F6 Rn/Mov Select File │"); WrLn;
WrStr(" F7 Make DIR │ Shift-F7 Make DIR │ Alt-F7 Find-File Window ");
WrStr(" F8 Delete File │ Shift-F8 Del Selected File │ Alt-F8 Command History ");
WrStr(" F9 Setup Menu │ Shift-F9 Save Setup to Disk │ Alt-F9 43/50 Line Mode ");
WrStr(" F10 Quit NC │"); WrCharRep(' ',31); WrStr("│ Alt-F10 NCD Tree Window");
GotoXY(1,13);
WrStr(" Home Begin of List │ ^U Swap Panels │ Ins Sel/De-Sel File ");
WrStr(" End End of List │ ^O Toggle All On/Off │ Gray + Sel File Group ");
WrStr(" "); WrChar(32C); WrStr(" Move Cursor │ ^P Inactive Panel Off │ Gray - De-Sel File Grp ");
WrStr(" ^\ Goto Root Dir │ ^L Status Panel │ Ctrl-PgUp Parent DIR ");
WrStr(" PgUp/Dn PgUp/Dn List │ ^I Switch (Also Tab) │ Ctrl-PgDn Subdirectory");
GotoXY(1,19);
WrStr(" Esc Cancels or quits process Ctrl-Break Cancels operation in progress ");
WrStr(" Enter Change into directory / execute command line or file under cursor ");
WrStr(" Ctrl-Enter Copy file / directory name to command line or Command complete ");
WrStr(" Ctrl-R Select drive to view in active panel and re-read directory ");
WrStr(" Alt-<key> Speed-search for file or directory name beginning with <key>");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(2,1);
WrCharRep(' ',31); WrStr("Function Keys"); WrCharRep(' ',32);
GotoXY(2,12);
WrCharRep(' ',25); WrStr("Panel Navigation & Control"); WrCharRep(' ',25);
GotoXY(2,18);
WrCharRep(' ',29); WrStr("General Operations"); WrCharRep(' ',29)
END Page1;
PROCEDURE Page2;
BEGIN
GotoXY(1,2);
WrStr(" Enter Execute │ ^T Del Word Right │ ^E Previous Command ");
WrStr(" ^Enter Copy Panel │ ^K Del to EOL │ ^X Next Command ");
WrStr(" ^, ^A Word Left │ ^Y,Esc Del Line │ ^S Cursor Left 1 Char ");
WrStr(" ^"); WrChar(32C); WrStr(", ^F Word Right │ ^G,Del Del Character │ ^D Cursor Right 1 Char ");
WrStr(" ^BS,^W Del Word Left │ BkSp Del Char Left │");
GotoXY(1,8);
WrStr(" , ^E Cursor Up Line │ Home Start of Line │ BS Del Character Left ");
WrStr(" , ^X Cursor Dn Line │ End End of Line │ Del, ^G Del Chacacter ");
WrStr(' '); WrChar(32C); WrStr(", ^D Cursor Right │^Home,^PgUp Start File │ BS, ^W Del Word left ");
WrStr(" , ^S Cursor Left │ ^End,^PgDn End File │ ^T Del Word Right ");
WrStr(" ^, ^A Word Left │ ^R, PgUp Page Up │ ^Y Del Line ");
WrStr(" ^"); WrChar(32C); WrStr(", ^F Word Right │ ^C, PgDn Page Down │ ^K Del to End of Line ");
WrStr(" F1 Help │ │ ^Q Quote Next Char ");
WrStr(" F2 Save │ Shift-F2 Save as ... │ F10, Esc Quit Editing ");
WrStr(" F7 Search │ Shift-F7 Search More │ Shift-F10 Save & Quit");
GotoXY(1,18);
WrStr(" , ^E Scroll Up Line │ Home Start of File │ F7 Search ");
WrStr(" , ^X Scroll Dn Line │ End End of File │ Shift-F7 Search More ");
WrStr(' '); WrChar(32C); WrStr(", ^D Scroll Right │^Home,^PgUp Start File │ Ctrl-Break Stop Search ");
WrStr(" , ^S Scroll Left │ ^End,^PgDn End File │ Esc, F10 Quit View ");
WrStr(" ^, ^A Scroll L 40col │ ^R, PgUp Page Up │"); WrLn;
WrStr(" ^"); WrChar(32C); WrStr(", ^F Scroll R 40col │ ^C, PgDn Page Down │");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(2,1);
WrCharRep(' ',29); WrStr("Command Line Keys"); WrCharRep(' ',30);
GotoXY(2,7);
WrCharRep(' ',31); WrStr("File Edit Keys"); WrCharRep(' ',31);
GotoXY(2,17);
WrCharRep(' ',31); WrStr("File View Keys"); WrCharRep(' ',31)
END Page2;
PROCEDURE Page3;
BEGIN
GotoXY(1,2);
WrStr(" , ^E Cell Up │ Home Top Left Cell │ ^, Tab Scroll Page L ");
WrStr(" , ^X Cell Down │ End Last Active Cell │ ^"); WrChar(32C); WrStr(", Shift-Tab Page R ");
WrChar(32C); WrStr(", ^D Cell Right │ ^R, PgUp Page Up │ Esc, F10 Quit View ");
WrStr(" , ^S Cell Left │ ^C, PgDn Page Down │");
GotoXY(1,7);
WrStr(" , ^E Scroll Back 1 │ Grey + Previous Rec. │ F1 General Info"); WrLn;
WrStr(" , ^X Scroll Fwd 1 │ Grey - Next Record │ F2 Field Info"); WrLn;
WrStr(" ^R, PgUp Page Up │^Home,^PgUp First Rec. │ F5 Goto Record"); WrLn;
WrStr(" ^C, PgDn Page Down │ ^End,^PgDn Last Rec. │ F7 Search"); WrLn;
WrStr(" Shift-F7 Search More │ Ctrl-Break Stop Srch. │ Esc, F10 Quit View");
GotoXY(1,13);
WrStr(" Panels Move Cursor : Single Click Left Button"); WrLn;
WrStr(" Scroll Up or Down : Single Click Left Button & Drag"); WrLn;
WrStr(" Point and Shoot : Double Click Left Button"); WrLn;
WrStr(" Select / De-Select File : Single Click Right Button"); WrLn;
WrStr(" Select / De-Select Group : Single Click Right Button & Drag"); WrLn;
WrStr(" Windows Execute Action : Single Click Either Button"); WrLn;
WrStr(" Execute Highlight Option : Single Click Right Button Outside Box ");
WrStr(" Menus Bring Up Menu Bar : Single Click Either Button on Top Row ");
WrStr(" Execute Menu Option : Single Click Either Button on Item ");
WrStr(" Shifted Version : Single Click Either Button Shift Down ");
WrStr(" General Cancel (Same as Esc Key) : Press BOTH Buttons and Release");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(2,1);
WrCharRep(' ',30); WrStr("Lotus View Keys"); WrCharRep(' ',31);
GotoXY(2,6);
WrCharRep(' ',30); WrStr("dBASE View Keys"); WrCharRep(' ',31);
GotoXY(2,12);
WrCharRep(' ',24); WrStr("General Rules Using a Mouse"); WrCharRep(' ',25)
END Page3;
PROCEDURE Page4;
BEGIN
GotoXY(1,3);
WrStr(" <F9> to call Setup, <Esc> Exits. Highlight section desired < "); WrChar(32C); WrStr(">, <Enter>. ");
WrStr(" Pull-down menus will appear. Check marks (√) show your current defaults. ");
WrStr(" Highlight a new option and press <Enter>. Setup will exit automatically, ");
WrStr(" reflecting change. IMPORTANT: To save changes permanently press <Shift-F9>.");
GotoXY(1,8);
WrStr(" Commands (HotKey) │ Options (Meaning) │ Right/Left (Meaning) ");
WrStr(" -------- │ ------- │ ----------"); WrLn;
WrStr(" NCDtree Alt-F10 │ Color Color Option │√ Brief File Names Only ");
WrStr(" Findfile Alt-F7 │ Auto menus Auto Menu On │ Full Full File Panel ");
WrStr(" History Alt-F8 │√ Path prompt C:\PATH> On │ Info Info Panel ");
WrStr(" 43/50Ln Alt-F9 │√ Key bar ^B Key Bar On │ Tree NCD Tree Panel ");
WrStr(" Swap panels ^U │√ Fullscreen Big Panel On │ On/Off Panel On/Off ");
WrStr(" Panel on/off ^O │√ Ministatus Stat Line On │ ----------"); WrLn;
WrStr(" Compare directory │√ Ins move dn LineFeed On │√ Name Sort by Name ");
WrStr(" Menu file edit │ cLock Dig Clock On │ eXt Sort by Ext ");
WrStr(" eXt file edit │ Editor... Specify your │ tiMe Sort by Time ");
WrCharRep(' ',37); WrStr("own editor │ Size Sort by Size ");
WrStr(' (Note: You can "jump" to the invoked <F4>,│ Unsorted No File Sort ');
WrStr(" selection just by pressing the uses NC.EXT │ ----------"); WrLn;
WrStr(" item's capitalized letter key). arguments. │ Shift-F2 ReRead Drive");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(3,1); WrStr(" Customizing Setup <F9> ")
END Page4;
PROCEDURE Page5;
BEGIN
GotoXY(1,3);
WrStr(" Bring up Setup <F9>, then Highlight [Commands] and select [eXt file edit].");
GotoXY(1,5);
WrStr(" Extension file edit allows you to run a file with any extension by calling ");
WrStr(" its application program. For example, a spreadsheet or word processor data ");
WrStr(" file gets its program application by matching the extension you specify to ");
WrStr(" the application. NC does this by inserting the program application on the ");
WrStr(" command line followed by the file/ext selected and executing the command.");
GotoXY(1,11);
WrStr(" A PATH in your autoexec.bat file may be required for DOS to locate your ");
WrStr(" program, or with DOS 3.0 and later include the entire path in NC.EXT file.");
GotoXY(1,14);
WrStr(" (Example) (Explanation) (NC.EXT Arguments) ");
WrStr(" "); GotoXY(62,15); WrStr(" "); WrLn;
WrStr(" c: c:\prg\bin\qc/b ! │ For example, the line: │ !.! Insert File Name and Ext ");
WrStr(" dbf: d:\db3\dbase ! │ wpd: c:\wp\wp !.! │ ! Insert File Name Only ");
WrStr(" doc: edit !.! │ Tells the Commander to │ !: Insert Current Drive & : ");
WrStr(" txt: edit !.! │ load file with the ext │ !/ Insert Path Name"); WrLn;
WrStr(" wkq: c:\quattro\q ! │ .wpd into WordPerfect, │ !! Insert Single !"); WrLn;
WrStr(" wpd: c:\wp\wp !.! │ if highlighted and the │ *: rem Remark for No Match ");
WrStr(" *: rem No Run File │ <Enter> key is pressed │ (*: Should be the last line)");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(3,1);
WrStr(" Extension File Edit NC.EXT ")
END Page5;
PROCEDURE Page6;
BEGIN
GotoXY(1,3);
WrStr(" Bring up Setup <F9>, then Highlight [Commands] and select [Menu file edit]. ");
WrStr(" NC will ask if you want to edit a Main (Global) or Local (Directory) Menu.");
GotoXY(1,6);
WrStr(" A Main Menu will pop-up from any location on the drive whenever <F2> is ");
WrStr(" pressed UNLESS a Local Menu is present in the directory you are in. In this ");
WrStr(" case the Local Menu will take priority and pop-up instead of the Main Menu.");
GotoXY(1,10);
WrStr(" NC will prompt you to create a new Menu file if one is not present. Once ");
WrStr(" in the Menu file edit screen create a menu file such as in the Example:");
GotoXY(1,13);
WrStr(" Writing This ... ───────────────────────────────── ... Produces This:"); WrLn;
WrStr(" (Example) (Explanation) (Sample Menu)"); WrLn;
WrStr(" "); GotoXY(63,15); WrStr(" "); WrLn;
WrStr(" 1:LoanPak 1.2 │ HotKey:Title for Menu │"); WrLn;
WrStr(" c:\bat\loan.bat │ INDENT command to execute │"); WrLn;
WrStr(" L:Lotus 123 2.01 │ HotKey:(Next) Menu Title │"); WrLn;
WrStr(" c:\lotus\123 │ INDENT command to execute │"); WrLn;
WrStr(" 'version 3.0 on D │ ' designates comment line │"); WrLn;
WrStr(" W:WordPerfect 5.0 │ (* Note the colon : between │"); WrLn;
WrStr(" c:\wp\wp │ HotKey & Menu Title *) │");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(3,1); WrStr(" Menu File Edit NC.MNU <F2> ")
END Page6;
PROCEDURE Page7;
BEGIN
GotoXY(14,2); WrStr("(Brief Panel)"); GotoXY(54,2); WrStr("(Full Panel)");
WrLn;
WrStr(" ╔═══════════╤═══════════╤═══════════╗ ╔══════════╤════════╤════════╤══════╗ ");
WrStr(" ║ Name │ Name │ Name ║ ║ Name │ Size │ Date │ Time ║ ");
WrStr(" ║ │append com│basica com║ ║ ║ ");
WrStr(" ║4201 cpi│assign exe│chkdsk com║ ║4201 cpi│ 16958│ 5-10-88│ 8:00a║ ");
WrStr(" ║5202 cpi│attrib com│command com║ ║5202 cpi│ 278│ 5-10-88│ 8:00a║ ");
WrStr(" ║ansi sys│backup com│comp com║ ║ansi sys│ 1912│ 5-10-88│ 8:00a║ ");
WrStr(" ╟───────────┴───────────┴───────────╢ ║append com│ 5794│ 5-10-88│ 8:00a║ ");
WrStr(" ║.. UP-DIR 1-01-80 1:40a║┐║assign exe│ 1534│ 5-10-88│ 8:00a║ ");
WrStr(" ╚═══════════════════════════════════╝ │╚══════════╧════════╧════════╧══════╝");
GotoXY(23,12); WrStr("√ Mini status on ┘"); WrLn;
WrStr(" ╔═══════════════════════════════════╗ ╔═══════════════════════════════════╗ ");
WrStr(" ║ The Norton Commander V2.0 (C)1988 ║ ║ ║ ");
WrStr(" ╟───────────────────────────────────╢ ║ ├──BAT √ cLock option on ─┘ ║ ");
WrStr(" ║ 655,360 Bytes Memory ║ ║ ├──DOS ║ ");
WrStr(" ║ 425,648 Bytes Free ║ ║ ├──PRG Enter Change Dir ║ ");
WrStr(" ║ 33,400,832 total bytes on drive C ║ ║ │ ├──M2 Grey+ Dn Same Level ║ ");
WrStr(" ║ 4,151,296 bytes free on Drive C ║ ║ │ └──MSC Grey- Up Same Level ║ ");
WrStr(" ║ C:\ ║ ║ └──WP Alt-Key Speed Search ║ ");
WrStr(" ╟───────────────────────────────────╢ ╟───────────────────────────────────╢ ");
WrStr(" ║ Root Dir (─ `DirInfo' F4 Edits) ║ ║C:\ ║ ");
WrStr(" ╚═══════════════════════════════════╝ ╚═══════════════════════════════════╝");
TextColor(LightGray);
TextBackground(Blue);
GotoXY(2,1); WrStr(" Panel Examples: Type and Position: <F9-Right/Left> Length: <F9-Options> ");
TextColor(Black); (* write "reversed" text *)
TextBackground(LightGray);
GotoXY(16,3); WrStr(" C:\DOS ");
GotoXY(56,3); WrStr(" C:\DOS ");
GotoXY(3,5); WrStr(".. ");
GotoXY(42,5); WrStr(".. │UP-DIR│ 1-01-80│ 1:40a");
GotoXY(17,13); WrStr(" Info ");
GotoXY(57,13); WrStr(" Tree ");
GotoXY(42,14); WrStr(" \ ")
END Page7;
PROCEDURE GetTime(VAR hrs, min, sec : CARDINAL);
VAR
r : SYSTEM.Registers;
BEGIN
r.AH := 2CH; (* get DOS time *)
Lib.Dos(r);
hrs := CARDINAL(r.CH);
min := CARDINAL(r.CL);
sec := CARDINAL(r.DH)
(* hsec := CARDINAL(r.DL) <- add this and declare variable for hundreths *)
END GetTime;
PROCEDURE WrTime;
CONST xArr = '0123456789'; (* constant for hours and minutes *)
yArr = ': '; (* constant for blinking colon ":" & " " *)
VAR hrs, min, sec : CARDINAL;
am : BOOLEAN;
BEGIN
GetTime(hrs, min, sec);
am := hrs < 12;
IF hrs > 11 THEN hrs := (hrs - 12) END; (* make a 12 hour clock *)
IF (hrs > 0) AND (hrs < 10) THEN (* skip 1st digit *)
WrChar(' ')
ELSE (* otherwise write "1" *)
WrChar('1')
END;
IF hrs = 0 THEN (* if midnight hour write "12" *)
WrChar('2')
ELSE
WrChar(xArr[hrs MOD 10])
END;
WrChar(yArr[sec MOD 2]); (* write a blinking colon *)
WrChar(xArr[min DIV 10 MOD 6]); (* write minutes *)
WrChar(xArr[min MOD 10]);
IF am THEN
WrChar('a') (* am - pm *)
ELSE
WrChar('p')
END
END WrTime;
PROCEDURE WrPage7Clocks; (* procedure for Page7 *)
BEGIN
REPEAT
GotoXY(72,13); WrTime;
GotoXY(33,3); WrTime
UNTIL KeyPressed();
ch := RdKey()
END WrPage7Clocks;
PROCEDURE WrPage(pagevalue:CARDINAL);
CONST xArr = '0123456789';
VAR WD : WinDef;
on : BOOLEAN; (* SetWrap() variable *)
BEGIN
Info(MWin,WD);
IF WD.Hidden = FALSE THEN (* check if the MWin window from procedure *)
Hide(MWin) (* Page6 is hidden before changing pages *)
END;
SetWrap(FALSE); (* free window border up for hard write *)
TextColor(Black);
TextBackground(Cyan);
GotoXY(16,25); WrStr(" Page of 7 - PgUp/Dn * Home/End - Esc Exits ");
GotoXY(22,25); WrChar(xArr[i]); (* insert the current page number *)
TextColor(LightGray);
TextBackground(Black);
SetWrap(on); (* text procedures use end of line wrap on *)
Clear; (* clear screen before each page write *)
CASE pagevalue OF
1 : Page1
| 2 : Page2
| 3 : Page3
| 4 : Page4
| 5 : Page5
| 6 : Page6; PutOnTop(MWin); Use(NCWin) (* show MWin when page6 is called *)
| 7 : Page7
END
END WrPage;
PROCEDURE GetPage;
CONST esc = 33C; up = 110C; pgup = 111C; home = 107C;
spc = 40C; dn = 120C; pgdn = 121C; end = 117C;
BEGIN
i := 1;
WrPage(i); (* start with Page1 *)
REPEAT
IF i = 7 THEN
WrPage7Clocks (* show the clocks if Page7 *)
ELSE ch := RdKey() END;
CASE ch OF
pgup, up : IF i = 1 THEN i := 7 ELSE DEC(i) END; WrPage(i)
| pgdn, dn, spc : IF i = 7 THEN i := 1 ELSE INC(i) END; WrPage(i)
| home : IF i # 1 THEN i := 1; WrPage(i) END
| end : IF i # 7 THEN i := 7; WrPage(i) END
END
UNTIL ch = esc (* repeat until escape key is hit *)
END GetPage;
BEGIN
OpenWindows; (* run program *)
GetPage;
Close(MWin); (* close windows on exit *)
Close(NCWin)
END NCREF20.