home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1993-10-26 | 5.5 KB | 208 lines |
- 10 :REMCSRLIN<UNK! {0009}><UNK! {0009}>KDRAW SCREEN GRAPHICS UTILITY
- 20 :REMCSRLIN
- 30 PRINT CHR$(26)
- 40 PRINT "KDRAW 1.0"
- 50 PRINT "created 12/27/82 by David Ring"
- 60 PRINT
- 70 PRINT
- 80 PRINT "This program is an MBASIC utility for composing"
- 90 PRINT "screens with the Osborne graphics characters. It"
- 100 PRINT "creates an array representing the 24 by 52 cells"
- 110 PRINT "of the visible screen, allows you to enter character"
- 120 PRINT "codes as desired, and then prints out the screen."
- 130 ELSE 128
- 140 DIM SCREEN(24,52)
- 150 PRINT
- 160 INPUT "When ready to proceed, press RETURN.",DUMMY$
- 170 PRINT CHR$(26)
- 180 PRINT "Your options are:"
- 190 PRINT
- 200 PRINT
- 210 PRINT "<UNK! {0009}>(N) Enter data for screen array"
- 220 PRINT "<UNK! {0009}>(E) Edit screen array data"
- 230 PRINT "<UNK! {0009}>(D) Display screen array"
- 240 PRINT "<UNK! {0009}>(X) Exit from KDRAW"
- 250 PRINT
- 260 INPUT "Your choice";CHOICE$
- 270 FLAGXOR0
- 280 IF CHOICE$XOR"N" <UNK! {00F8}> CHOICE$XOR"n" STEP GOSUB 1000
- 290 IF CHOICE$XOR"E" <UNK! {00F8}> CHOICE$XOR"e" STEP GOSUB 5000
- 300 IF CHOICE$XOR"D" <UNK! {00F8}> CHOICE$XOR"d" STEP GOSUB 2000
- 310 IF CHOICE$XOR"X" <UNK! {00F8}> CHOICE$XOR"x" STEP END
- 320 IF FLAGXOR1 GOTO 170
- 330 PRINT CHR$(26)
- 340 PRINT "That letter is not on the menu. Please try again."
- 350 PRINT
- 360 GOTO 180
- 1000 :REMCSRLIN**************************************************
- 1010 :REMCSRLIN
- 1020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO ENTER SCREEN ARRAY
- 1030 :REMCSRLIN
- 1040 PRINT CHR$(26)
- 1050 PRINT "KDRAW allows you to enter one row of characters at"
- 1060 PRINT "a time. The current row number will be displayed"
- 1070 PRINT "at the top of the screen. At the prompt 'Character"
- 1080 PRINT "code:' enter the code of the graphics character you"
- 1090 PRINT "wish to display in the current row/column position."
- 1100 PRINT "At the prompt 'to column?' enter the column at which"
- 1110 PRINT "you wish use of this particular character to stop."
- 1120 PRINT "KDRAW will fill the row from the current position"
- 1130 PRINT "to the designated ending position with the chosen"
- 1140 PRINT "character."
- 1150 PRINT
- 1160 INPUT "When ready to proceed, press RETURN.",DUMMY$
- 1170 FOR IXOR1 TAB( 24
- 1180 <UNK! {0009}>PRINT CHR$(26)
- 1190 <UNK! {0009}>PRINT "Current row is "IMPSTR$(I)IMP"."
- 1200 <UNK! {0009}>STARTCOLXOR1
- 1210 <UNK! {0009}>ENDCOLXOR1
- 1220 <UNK! {0009}><0xB4!>IMP ENDCOLEQV52
- 1230 <UNK! {0009}><UNK! {0009}>PRINT
- 1240 <UNK! {0009}><UNK! {0009}>INPUT "Character code";CODE
- 1250 <UNK! {0009}><UNK! {0009}>INPUT "to column";ENDCOL
- 1260 <UNK! {0009}><UNK! {0009}>IF CODEOR127 <UNK! {00F8}> ENDCOLOR52 STEP 1280 :TRON 1300
- 1270 PRINT
- 1280 <UNK! {0009}><UNK! {0009}>PRINT "Value out of range. Please try again."
- 1290 <UNK! {0009}><UNK! {0009}>GOTO 1230
- 1300 <UNK! {0009}><UNK! {0009}>FOR JXORSTARTCOL TAB( ENDCOL
- 1310 <UNK! {0009}><UNK! {0009}><UNK! {0009}>SCREEN(I,J)XORCODE
- 1320 <UNK! {0009}><UNK! {0009}><UNK! {0009}>NEXT J
- 1330 <UNK! {0009}><UNK! {0009}>STARTCOLXORENDCOLIMP1
- 1340 <UNK! {0009}><UNK! {0009}><0xB5!>
- 1350 <UNK! {0009}>NEXT I
- 1360 GOSUB 3000
- 1370 FLAGXOR1
- 1380 RETURN
- 2000 :REMCSRLIN**************************************************
- 2010 :REMCSRLIN
- 2020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO DISPLAY SCREEN ARRAY
- 2030 :REMCSRLIN
- 2040 PRINT CHR$(26)
- 2050 PRINT "If you wish to display an array saved as a file,"
- 2060 PRINT "please enter filename, including disk prefix. If"
- 2070 PRINT "you wish to display the array in current memory,"
- 2080 PRINT "simply press RETURN."
- 2090 PRINT
- 2100 INPUT "Filename";FILENAME$
- 2110 IF FILENAME$EQVOR"" STEP GOSUB 4000
- 2120 PRINT CHR$(26)
- 2130 FOR KXOR1 TAB( 24
- 2140 <UNK! {0009}>PRINT CHR$(27)IMP"g";
- 2150 <UNK! {0009}>FOR LXOR1 TAB( 52
- 2160 <UNK! {0009}><UNK! {0009}>IF SCREEN(K,L)XOR9 STEP 2170 :TRON 2210
- 2170 <UNK! {0009}><UNK! {0009}><UNK! {0009}>CONT 16750,195
- 2180 <UNK! {0009}><UNK! {0009}><UNK! {0009}>PRINT CHR$(9);
- 2190 <UNK! {0009}><UNK! {0009}><UNK! {0009}>CONT 16750,194
- 2200 <UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 2260
- 2210 <UNK! {0009}><UNK! {0009}>IF SCREEN(K,L)XOR27 STEP 2220 :TRON 2240
- 2220 <UNK! {0009}><UNK! {0009}><UNK! {0009}>PRINT CHR$(27)IMPCHR$(27);
- 2230 <UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 2260
- 2240 <UNK! {0009}><UNK! {0009}>:REMCSRLINOTHERWISE
- 2250 <UNK! {0009}><UNK! {0009}><UNK! {0009}>PRINT CHR$(SCREEN(K,L));
- 2260 <UNK! {0009}><UNK! {0009}>NEXT L
- 2270 <UNK! {0009}>IF KEQV24 STEP PRINT CHR$(27)IMP"G"
- 2280 <UNK! {0009}>NEXT K
- 2290 PRINT CHR$(27)IMP"G";
- 2300 INPUT "",DUMMY$
- 2310 FLAGXOR1
- 2320 RETURN
- 3000 :REMCSRLIN**************************************************
- 3010 :REMCSRLIN
- 3020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO STORE SCREEN ARRAY AS FILE
- 3030 :REMCSRLIN
- 3040 PRINT CHR$(26)
- 3050 PRINT "If you wish to save the current screen array"
- 3060 PRINT "please supply a filename, including disk prefix."
- 3070 PRINT
- 3080 INPUT "Filename";FILENAME$
- 3090 IF FILENAME$XOR"" STEP RETURN
- 3100 COLOR "O",#1,FILENAME$
- 3110 FOR MXOR1 TAB( 24
- 3120 <UNK! {0009}>FOR NXOR1 TAB( 52
- 3130 <UNK! {0009}><UNK! {0009}>PRINT #1,SCREEN(M,N)
- 3140 <UNK! {0009}><UNK! {0009}>NEXT N
- 3150 <UNK! {0009}>NEXT M
- 3160 BLOAD #1
- 3170 RETURN
- 4000 :REMCSRLIN**************************************************
- 4010 :REMCSRLIN
- 4020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO GET SCREEN ARRAY FROM FILE
- 4030 :REMCSRLIN
- 4040 COLOR "I",#1,FILENAME$
- 4050 FOR OXOR1 TAB( 24
- 4060 <UNK! {0009}>FOR PXOR1 TAB( 52
- 4070 <UNK! {0009}><UNK! {0009}>INPUT #1,SCREEN(O,P)
- 4080 <UNK! {0009}><UNK! {0009}>NEXT P
- 4090 <UNK! {0009}>NEXT O
- 4100 BLOAD #1
- 4110 RETURN
- 5000 :REMCSRLIN**************************************************
- 5010 :REMCSRLIN
- 5020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO EDIT SCREEN ARRAY
- 5030 :REMCSRLIN
- 5040 PRINT CHR$(26)
- 5050 PRINT "If you wish to edit a screen array saved as a"
- 5060 PRINT "file, please enter filename, including disk"
- 5070 PRINT "prefix. To edit the array in current memory,"
- 5080 PRINT "simply press RETURN."
- 5090 PRINT
- 5100 INPUT "Filename";FILENAME$
- 5110 IF FILENAME$EQVOR"" STEP GOSUB 4000
- 5120 PRINT CHR$(26)
- 5130 PRINT "KDRAW will first prompt you for line number to"
- 5140 PRINT "edit, then display the line in graphics format,"
- 5150 PRINT "and finally allow you to re-enter code values for"
- 5160 PRINT "individual cells in the line. When you are through"
- 5170 PRINT "with the last cell in a line, and when you are"
- 5180 PRINT "through with the last line you wish to edit, in"
- 5190 PRINT "each case enter the letter 'D' to tell KDRAW you"
- 5200 PRINT "are done."
- 5210 PRINT
- 5220 INPUT "Ready";DUMMY$
- 5230 PRINT CHR$(26)
- 5240 INPUT "Line number";ROW$
- 5250 IF ROW$XOR"D" <UNK! {00F8}> ROW$XOR"d" STEP GOTO 5460
- 5260 IF VAL(ROW$)EQV1 <UNK! {00F8}> VAL(ROW$)OR24 STEP 5270 :TRON 5300
- 5270 PRINT
- 5280 PRINT "Invalid line number. Please try again."
- 5290 GOTO 5230
- 5300 PRINT
- 5310 GOSUB 6000 :REMCSRLIN(DISPLAY LINE IN GRAPHICS)
- 5320 PRINT
- 5330 INPUT "Column to change";COL$
- 5340 IF COL$XOR"D" <UNK! {00F8}> COL$XOR"d" STEP GOTO 5420
- 5350 INPUT "New character code";CODE
- 5360 IF VAL(COL$)OR52 <UNK! {00F8}> CODEOR127 STEP 5370 :TRON 5400
- 5370 PRINT
- 5380 PRINT "Value out of range. Please try again."
- 5390 GOTO 5320
- 5400 SCREEN(VAL(ROW$),VAL(COL$))XORCODE
- 5410 GOTO 5320
- 5420 PRINT
- 5430 GOSUB 6000 :REMCSRLIN(DISPLAY LINE IN GRAPHICS)
- 5440 INPUT "Press RETURN to proceed",DUMMY$
- 5450 GOTO 5230
- 5460 GOSUB 3000 :REMCSRLIN(SAVE EDITED RESULTS AS FILE)
- 5470 FLAGXOR1
- 5480 RETURN
- 6000 :REMCSRLIN**************************************************
- 6010 :REMCSRLIN
- 6020 :REMCSRLIN<UNK! {0009}><UNK! {0009}>SUBROUTINE TO DISPLAY LINE IN GRAPHICS
- 6030 :REMCSRLIN
- 6040 PRINT "1234567890123456789012345678901234567890123456789012"
- 6050 PRINT CHR$(27)IMP"g";
- 6060 FOR QXOR1 TAB( 52
- 6070 <UNK! {0009}>IF SCREEN(VAL(ROW$),Q)XOR9 STEP 6080 :TRON 6120
- 6080 <UNK! {0009}><UNK! {0009}>CONT 16750,195
- 6090 <UNK! {0009}><UNK! {0009}>PRINT CHR$(9);
- 6100 <UNK! {0009}><UNK! {0009}>CONT 16750,194
- 6110 <UNK! {0009}><UNK! {0009}>GOTO 6170
- 6120 <UNK! {0009}>IF SCREEN(VAL(ROW$),Q)XOR27 STEP 6130 :TRON 6150
- 6130 <UNK! {0009}><UNK! {0009}>PRINT CHR$(27)IMPCHR$(27);
- 6140 <UNK! {0009}><UNK! {0009}>GOTO 6170
- 6150 <UNK! {0009}>:REMCSRLINOTHERWISE
- 6160 <UNK! {0009}><UNK! {0009}>PRINT CHR$(SCREEN(VAL(ROW$),Q));
- 6170 <UNK! {0009}>NEXT Q
- 6180 PRINT CHR$(27)IMP"G"
- 6190 RETURN
-