home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib42a.dsk
/
MAY.1992
/
ALIAS.WS.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
4KB
|
54 lines
10 REM ************************
11 REM * ALIAS WORKSHOP *
12 REM * by Benoit Gilon *
13 REM * Copyright (C) 1992 *
20 REM * MindCraft Publ. Corp.*
30 REM * Lincoln, MA 01773 *
40 REM ************************
50 REM ** CHECK THE ENVIRONMENT
60 TEXT : NORMAL : PRINT CHR$(21);: IF PEEK(48896) < >76 THEN PRINT "THIS PROGRAM MUST BE RUN UNDER PRODOS.": STOP
70 DIM OF%(5),AD%(5): FOR P = 0 TO 5: READ OF%(P),AD%(P): NEXT P: DATA 0,826,24,853,40,842,72,865,88,836,104,859
80 P1 = PEEK(42631):P2 = PEEK(42632)
90 ON P1 = 8 GOTO 140: ON P1 = 27 AND P2 = 170 GOTO 100: PRINT "UNKNOWN COMMAND ENHANCER FOUND": STOP
100 ONERR GOTO 120
110 PRINT CHR$(4)"-ALIAS": POKE 216,0: GOTO 130
120 PRINT "UNABLE TO LOAD ALIAS, SORRY..": POKE 216,0: STOP
130 P1 = PEEK(42631):P2 = PEEK(42632)
140 AF = P2 *256 +1132: PRINT CHR$(4)"BLOAD ALWSOBJ": POKE 811,P2 +2: FOR P = 0 TO 5: POKE AD%(P) +1,(AF +OF%(P))/256: NEXT P
150 ON PEEK(49050) GOTO 170: PRINT CHR$(4)"PREFIX": INPUT PF$: PRINT CHR$(4)"PREFIX"PF$: REM GETBIPREFIXANDSETMLIPREFIX
160 REM ** MAIN MENU
170 HOME :P$ = "** ALIAS WORKSHOP **": GOSUB 420:P$ = "an ALIAS companion program": GOSUB 440:P$ = "by Benoit Gilon": GOSUB 420:P$ = "Copyright (C) 1992": GOSUB 440:P$ = "MindCraft Publishing Corp.": GOSUB 440: VTAB 11
180 PRINT " 1: See current Alias definitions": PRINT
190 PRINT " 2: Purge all definitions from memory": PRINT
200 PRINT " 3: Append definitions from a file": PRINT
210 PRINT " 4: Save defintions to a file": PRINT
220 PRINT " 5: Exit Alias Workshop": PRINT : PRINT ":";
230 GET P$: ON ASC(P$) = 3 GOTO 460: ON P$ <"1" OR P$ >"5" GOTO 230: PRINT : HOME : ON VAL(P$) GOTO 240,300,330,370,460
240 P$ = "ALIAS DEFINITION TABLE": GOSUB 420:P = PEEK(37)
250 PRINT CHR$(4)"SAD": GOTO 280
260 POKE 216,0:ER = PEEK(222)
270 PRINT "ERROR OCCURED, CODE:"ER: GOTO 290
280 IF P = PEEK(37) THEN PRINT "TABLE EMPTY"
290 PRINT : PRINT "PRESS ANY KEY TO CONTINUE";: GET R$: GOTO 170
300 P$ = "FROM MEMORY ALIAS PURGE PHASE": GOSUB 420
310 FOR P = 1 TO 16: PRINT CHR$(4)"UNALIAS "P: NEXT P
320 PRINT "DONE.": GOTO 290
330 P$ = "APPEND FROM FILE PHASE": GOSUB 420
340 GOSUB 480: ONERR GOTO 360
350 PRINT CHR$(4)"VERIFY "NF$: POKE 216,0: CALL 778: GOTO 290
360 POKE 216,0:ER = PEEK(222): ON ER < >6 AND ER < >7 GOTO 270: PRINT "PATH NOT FOUND": GOTO 290
370 P$ = "SAVE AS AN ALIAS FILE PHASE": GOSUB 420
380 GOSUB 480: ONERR GOTO 400
390 PRINT CHR$(4)"CREATE "NF$",TBIN": POKE 216,0: CALL 774:ER = PEEK(777): ON ER GOTO 270: GOTO 290
400 POKE 216,0:ER = PEEK(222): ON ER < >19 GOTO 270: PRINT "FILE ALREADY EXISTS.. NOW WHAT?": PRINT "<C>ANCEL <P>ROCEED: ";: GET P$: PRINT P$: ON P$ < >"P" AND P$ < >"p" GOTO 290: PRINT CHR$(4)"UNLOCK"NF$: PRINT CHR$(4)"DELETE"NF$: GOTO 390
410 END
420 GOSUB 440: PRINT : RETURN
430 REM ** CENTER LINE ON SCREEN
440 HTAB 20 - LEN(P$) *.5: PRINT P$: RETURN
450 REM ** EVEN GREAT PROGRAMS MUST HAVE AN END
460 HOME : PRINT "Bye/Au Revoir/Adios/Auf Wiedersehen!": PRINT CHR$(4)"PREFIX"PF$: END
470 REM GET A FILE PATHNAME
480 PRINT "Enter <?> to catalog current directory.": PRINT "Press <Return> for Main Menu.": PRINT
490 INVERSE : PRINT "FILENAME";: NORMAL : INPUT ": ";NF$: ON NF$ < >"" GOTO 500: POP : GOTO 170
500 ON LEFT$(NF$,1) < >"?" GOTO 510:DR$ = "": FOR P = 1 TO LEN(NF$):VA = ASC( MID$ (NF$,P,1)):DR$ = DR$ + CHR$(VA +(44 -VA) *(VA = 35)): NEXT P: PRINT CHR$(4)"CAT" MID$ (DR$,2): GOTO 490: REM 44= "," - 35="#"
510 RETURN