home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #7 / utv2n7s1.d64 / seq (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  22KB  |  510 lines

  1. 10 rem (c) 1988 uptime magazine
  2. 20 rem (c) 1988 softdisk publishing inc.
  3. 30 rem author: noel nyman
  4. 40 rem gray border, black screen, light green text
  5. 45 sys65409
  6. 50 poke53280,11:poke53281,0:poke646,13
  7. 60 rem q$=quotes, force upper/lower case, run/stop disabled
  8. 70 q$=chr$(34):printchr$(14)chr$(8):sp$="                   ":poke808,234
  9. 80 rem --- sys (NULL),x,y places cursor at row x, column y ---
  10. 90 q=679:forx=qto706:reada:pokex,a:next
  11. 100 data 32,253,174,32,158,173,32,170,177,132,2,32,253,174,32,158
  12. 110 data 173,32,170,177,166,2,76,240,255,56,176,250
  13. 120 rem skip sub-routines
  14. 130 goto560
  15. 140 rem *** clear screen to line 23 starting at line 'x' ***
  16. 150 x=10:gosub160:sysq,10,3:return
  17. 160 fory=xto23:sysq,y,0:sys 59903:pokey+217,peek(y+217)or128:next
  18. 170 return
  19. 180 rem *** filter keyboard input for string ***
  20. 190 rem ---returns string in xx$ length 'll' or smaller---
  21. 200 xx$="":xb=65:xe=90:goto220:rem lower case alpha only
  22. 210 xx$="":xb=48:xe=57:goto220:rem numeric only
  23. 220 gosub270:xa=asc(cg$):ifxa=13andxx$<>""thenreturn
  24. 230 if(xa=20)and(xx$<>"")thenprintcg$;:xx$=left$(xx$,len(xx$)-1):goto220
  25. 240 if(xa<xb)or(xa>xe)goto220
  26. 250 iflen(xx$)>=llgoto220
  27. 260 printcg$;:xx$=xx$+cg$:goto220
  28. 270 xl%=peek(211)
  29. 280 if(xl%>39)thenxl%=xl%-40:goto280
  30. 290 xl%=xl%+peek(214)*40+1024:xc=54272+xl%
  31. 300 pokexc,peek(646):xo%=peek(xl%):xt%=xo%:xq%=128:if(xo%>127)thenxq%=-xq%
  32. 310 xt%=xt%+xq%:pokexl%,xt%:xq%=-xq%
  33. 320 forxr=1to60
  34. 330 getcg$:if(cg$<>"")thenpokexl%,xo%:xr=61:next:return
  35. 340 next:goto310
  36. 350 rem *** delay loop ***
  37. 360 rem --- enter with delay time in x ---
  38. 370 fora=1tox:next:return
  39. 380 fory=11to16:sysq,6,y:print"[158]->[153]":x=50:gosub370:next:return
  40. 390 gosub420:sysq,5,19:printsp$:sysq,6,19:printsp$:return
  41. 400 sysq,0,0:sys59903:return
  42. 410 fory=16to11step-1:sysq,6,y:print"<*":x=50:gosub370:next:return
  43. 420 sysq,6,11:print"       ":return
  44. 430 rem *** prompt ***
  45. 440 sys679,24,1:print"[152][211][208][193][195][197] [194][193][210] to continue - [198]8 for [213][208][212][201][205][197][146][153]";
  46. 450 wait198,1:poke198,0
  47. 460 if(peek(631)=32)or(peek(631)=13)thenwait197,64:return
  48. 470 ifpeek(631)<>140goto450
  49. 480 rem re-enter uptime environment
  50. 490 printchr$(9): rem enable shift/c=
  51. 500 poke186,8: rem device #8
  52. 510 poke808,237: rem re-enable run-stop
  53. 520 load"reboot",8
  54. 530 rem ***************************
  55. 540 rem   main program starts here
  56. 550 rem ***************************
  57. 560 print"[147]"
  58. 570 print"[158]       [182][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][181]
  59. 580 [153]"sys       abs print(NULL)(NULL)right$(NULL)chr$ (NULL)val(NULL)(NULL)val(NULL)(NULL)right$atn(NULL) ascright$(NULL)val(NULL) sysint
  60. 590 print"       [182][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][181]
  61. 600 [153]"print#     published by (NULL)oftdisk (NULL)ublishing
  62. 610 print"     written for [213][208][212][201][205][197] by [206]oel [206]yman
  63. 620 [153]"print   (NULL)n many disks, you've seen files in
  64. 630 print"the disk directory with [211][197][209][153] following
  65. 640 [153]"their names.  sys(NULL)val(NULL)printuential files are often";
  66. 650 [153]"used by programmers to store data.  They";
  67. 660 [153]"can also be used for word processor and
  68. 670 print"other text files.
  69. 680 [153]"   (NULL)e're going to show you how to make
  70. 690 print"your own [158][211][197][209][153] files to hold data from
  71. 700 [153]"your programs, and how to read just
  72. 710 print"about any [158][211][197][209][153] file.":gosub440
  73. 720 print"[147]
  74. 730 [153]"lenomputer asciles          str$isk asciles
  75. 740 print"[129][163][163][163][163][163][163][163][163][163][163][163][163][163][163]          [163][163][163][163][163][163][163][163][163][163]
  76. 750 [153]"list10    8    2         1  "q$"(NULL)(NULL)(NULL)right$(NULL)val"q$"     (NULL)(NULL)chr$
  77. 760 print" 4    4    0         15 "q$"[204][197][212][212][197][210]"q$"     [211][197][209]
  78. 770 [153]"15    8   15         12 "q$"asc(NULL)(NULL)chr$chr$right$val"q$"    (NULL)(NULL)chr$
  79. 780 print"[153]   [213]nfortunately, the same word is often";
  80. 790 print"used in the computer world to mean two
  81. 800 [153]"different things.  (NULL)he word "q$"file"q$"print has
  82. 810 print"two meanings for [195]ommodore computers.
  83. 820 [153]"   (NULL)ou already know that a collection of";
  84. 830 [153]"data on a diskprint is known as a sysfileprint.
  85. 840 print"   [212]he computer[153] also uses [158]files[153], but
  86. 850 [153]"for a different purpose.":[141]440
  87. 860 [153]"loadlist(NULL)(NULL)val(NULL) 4, 4, 0: len(NULL)str$ 4: (NULL)right$(NULL)(NULL)print
  88. 870 print"   [217]ou may have used computer files
  89. 880 [153]"without knowing it.  The set of commands";
  90. 890 [153]"above (NULL)right$(NULL)(NULL)prints a peekatn(NULL)right$len program to your":[153]"printer.
  91. 900 gosub440:sysq,1,8:print "^
  92. 910 [158]q,2,6:[153]"deviceprint":[141]150
  93. 920 [153]"(NULL)his is the device numberprint. (NULL)ost
  94. 930 print"[195]ommodore printers are [158]device #4[153].
  95. 940 [141]440:[158]q,1,8:[153]"   ^
  96. 950 sysq,2,3:print"secondary address[153]":sysq,14,0
  97. 960 print"   [212]his number is called the secondary
  98. 970 [153]"addressprint.  (NULL)ome devices use this number
  99. 980 print"for special purposes.  [193] secondary
  100. 990 [153]"address of syszeroprint puts lenommodore printers
  101. 1000 print"into [213]pper [195]ase/[199]raphics mode.
  102. 1010 [141]440:[158]q,1,5:[153]"^            ^
  103. 1020 sysq,2,1:print"file number  file number[153]":sysq,21,3
  104. 1030 print"[212]his number is the file number[153].":gosub440
  105. 1040 print"[147][155][207][208][197][206][153]
  106. 1050 [158]59903:[153]"   atn computer fileprint is the reference
  107. 1060 print"used by the machine and the programmer
  108. 1070 [153]"for input/output or sysright$/(NULL)print activity.  (NULL)o
  109. 1080 print"communicate with a printer, modem, or
  110. 1090 [153]"disk drive, you must create or (NULL)(NULL)val(NULL)print a":[153]"file.
  111. 1100 print"   [212]he computer keeps track of files by
  112. 1110 [153]"using the file numberprint.  (NULL)his number
  113. 1120 print"can be any whole number from 1[153] through
  114. 1130 [153]"127print.  ((NULL)he numbers sys128print through sys255print
  115. 1140 print"are used to add an extra blank line when";
  116. 1150 print"[158][204][201][211][212][153]ing programs to a printer.)
  117. 1160 [153]"   (NULL)ow, enter a number between 1print and
  118. 1170 print"127[153] for a file number."
  119. 1180 print"---> ";:x$=""
  120. 1190 ll=3:gosub210:xx=val(xx$):if(xx>0)and(xx<128)goto1220
  121. 1200 print"[147][153][217]our number should be between [158]1[153]
  122. 1210 [153]"and sys127print.   (NULL)ry again.":[137]1180
  123. 1220 fl$[178]xx$:[153]"loadlist(NULL)(NULL)val(NULL) "fl$"
  124. 1230 print"[153]   [207]nce we set up or "q$"open"q$"[153] a file,
  125. 1240 [153]"we have to tell the computer which
  126. 1250 print"device we want to use with that file.
  127. 1260 [153]"   (NULL)ince we're going to create a sys(NULL)val(NULL)print
  128. 1270 print"disk file, we'll use device #8[153].":gosub440
  129. 1280 print"[155]"tab(5+len(fl$))",8
  130. 1290 [141]150:[153]"printstr$on't forget the sys"q$","q$"print between the
  131. 1300 print"file number and the device number.":gosub440
  132. 1310 print "[147][155][207][208][197][206] "fl$",8"
  133. 1320 print"[147][155][207][208][197][206] "fl$",8":print"[153]   [212]he [158]secondary address[153] you need to use";
  134. 1330 print"depends on the device.  [208]rinters and
  135. 1340 [153]"printer interfaces use the secondary
  136. 1350 print"address to change printing styles.
  137. 1360 [153]"   str$isk drives use the syssecondary addressprint";
  138. 1370 [153]"in the same way that the computer uses
  139. 1380 print"file numbers.  [198]or a disk drive, the
  140. 1390 [153]"secondary address is often called a":[153]"channelprint.
  141. 1400 print"   [215]hen you want to [204][207][193][196], [211][193][214][197], read
  142. 1410 [153]"from, or write to a file, the disk drive";
  143. 1420 [153]"keeps track of which file on the disk to";
  144. 1430 [153]"use by a channelprint number.":[141]440
  145. 1440 [153]"load(NULL)et's review for a moment.
  146. 1450 print"[215]hich answer is correct?
  147. 1460 [153]"   atn) (NULL)he computer and the disk drive
  148. 1470 print"      both use [158]file numbers[153] to keep
  149. 1480 [153]"      track of right$/(NULL)