Compucolor.org – Virtual Media

Listing of file='HANDLR.BAS;01' on disk='vmedia/chip_63-sector.ccvf'

100 PLOT 12:REM  SCRIPT HANDLER PROGRAM VER 3.5 MARCH 82 
110 REM  BY: MYRON T. STEFFY, SUN CITY, ARIZONA 85351
120 POKE 32940,255:POKE 32941,148:REM  PROTECT PROGRAM
130 CLEAR 50:IF PEEK (38175)+ PEEK (38176)= 206THEN 160
140 PRINT TAB( 16)"LOADING MACHINE LANGUAGE"
150 PLOT 27,4:PRINT "LOAD SCRIPT.PRG;01":PLOT 27,27
160 POKE 33283,0:POKE 33284,149:REM  START OF SCRIPT.PRG;01
170 X= CALL (Y)
180 POKE 33283,57:POKE 33284,149:REM  RE-ENTRY POINT
190 PRINT :INPUT "WHICH DISK DRIVE WILL YOU BE USING ? ";DR$
200 IF DR$< > "0"AND DR$< > "1"THEN 190
210 PRINT :PRINT "INSERT SOURCE FILE DISKETTE IN DRIVE ";DR$
220 PRINT :INPUT "THEN PRESS ENTER: ";C$:PLOT 6,6,12
230 PLOT 27,4:PRINT "DIR";DR$;":":PLOT 27,27
240 INPUT "ENTER THE NAME OF THE FILE: ";C$:PRINT
250 IF C$= "0"OR LEN (C$)> 6THEN PLOT 28,11:GOTO 240
260 INPUT "ENTER THE TYPE OF FILE ( SRC or DOC ): ";T$
270 PRINT :IF T$= "SRC"THEN AD$= "B000"
280 IF T$= "DOC"THEN AD$= "AFC0"
290 INPUT "ENTER THE (VERSION) NUMBER: ";V$
300 IF V$= "0"OR LEN (V$)> 2THEN PLOT 28,11:GOTO 290
310 PRINT
320 PRINT TAB( 8)"LOADING "C$"."T$";"V$" "AD$:PLOT 27,27:PRINT
330 PLOT 27,4:PRINT "LOAD"DR$":"C$"."T$";"V$" "AD$:PLOT 27,27:PRINT
340 PRINT :PRINT "FOR DEFAULT VALUES, JUST PRESS RETURN"
350 PRINT
360 INPUT "ENTER NUMBER OF LINES PER/PAGE: (55 NORMAL) ";C:PRINT
370 IF C= 0THEN C= 55
380 POKE 39201,C:REM  'PSIZ'
390 INPUT "ENTER NUMBER OF LINES PER/FORM FEED: (DEFAULTS TO 0) ";C
400 POKE 39202,C:REM  'WHITE'
410 REM  RESET LCOUNT, PAUSE, SFILE, JFLAG, RJFLG  FLAGS
420 POKE 39194,0:POKE 39196,13:POKE 39197,0:POKE 39198,1:POKE 39204,0
430 PRINT :INPUT "ENTER 'NO' TO CANCEL JUSTIFICATION ";N$
440 IF LEFT$ (N$,1)= "N"THEN POKE 39198,0:GOTO 470
450 PRINT :INPUT "ENTER 'YES' IF THIS FILE IS TO BE RE-JUSTIFIED ";RJ$
460 IF LEFT$ (RJ$,1)= "Y"THEN POKE 39204,1:POKE 39198,1:GOTO 470
470 PRINT :PRINT "CREATE A NEW FILE AT 0A002H ( Y or N ) ? "
480 PRINT :INPUT "( OLD FILE WILL BE OVERWRITTEN ) ";CF$
490 IF CF$= "Y"THEN POKE 39197,1
500 PRINT
510 PRINT "FIRST PAGE WILL HAVE 0 BLANK LINES AT THE TOP: "
520 PRINT :INPUT "TO CHANGE, ENTER THE DESIRED NUMBER ";F
530 POKE 39194,F:REM  'LCOUNT' - PRELOADS LINE COUNTER
540 PRINT :INPUT "PLEASE SELECT BAUD RATE, ( 1 - 7 ) DEFAULTS TO 7: ";B
550 IF B= 0THEN B= 7:REM  DEFAULT RATE
560 IF B> 7THEN 540
570 IF B= 1THEN BR= 1:GOTO 590
580 BR= 128+ 2^ (B- 1):REM  CONVERT BAUD RATE
590 POKE 39203,BR
600 X= CALL (Y)
610 IF CF$= "Y"THEN GOSUB 740:REM  WANT TO SAVE THE FILE ?
620 IF CF$= "Y"THEN CF$= "":GOTO 670
630 IF RJ$= "Y"THEN RJ$= "":GOTO 670
640 PRINT :INPUT "WOULD YOU LIKE TO SEE THE SAME LISTING: ";C$
650 IF LEFT$ (C$,1)< > "Y"THEN 670
660 PLOT 12:GOTO 340
670 PRINT :INPUT "WOULD YOU LIKE TO SEE ANOTHER LISTING: ";C$
680 IF LEFT$ (C$,1)< > "Y"THEN 730
690 POKE 33283,0:POKE 33284,149:REM  CLEAR MEMORY
700 X= CALL (Y)
710 POKE 33283,57:POKE 33284,149
720 GOTO 210
730 PLOT 18,15,12:END
740 CT= PEEK (40960)+ PEEK (40961)* 256:REM  END OF NEW FILE
750 SZ= CT- 40962
760 PRINT
770 PRINT "THE NEW FILE AT A002H CONTAINS ";SZ;" BYTES."
780 PRINT
790 INPUT "DO YOU WISH TO SAVE IT ON DISC ? ( Y or N ) ";D$
800 PRINT :IF D$< > "Y"THEN 670
810 PRINT "INSTALL A DISC IN THE DEFAULT DRIVE WITH SPACE FOR ";SZ;" BYTES."
820 PRINT :INPUT "PRESS RETURN WHEN READY: ";R:PRINT
830 INPUT "WHAT IS THE NAME OF THE FILE TO BE SAVED ? ";N$
840 IF N$= "0"OR LEN (N$)> 6THEN 860
850 PRINT :T= SZ:GOSUB 1000
860 PLOT 27,4:PRINT "SAVE ";N$;".SRC A002 ";H$:PLOT 27,27
870 PRINT
880 PRINT "THE NEW FILE HAS BEEN RECORDED AS  ";N$;".SRC A002 "
890 RETURN
1000 REM  DECIMAL TO HEX CONVERSION
1010 H$= "":X= 4096
1020 IF T< 256THEN X= 16
1030 H= INT (T/ X):T= T- (H* X)
1040 H= H+ 48:IF H> 57THEN H= H+ 7
1050 H$= H$+ CHR$ (H)
1060 X= X/ 16:IF X< 1THEN RETURN
1070 GOTO 1030