home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 65 / 065.d81 / basic4.docs < prev    next >
Encoding:
Text File  |  1989-01-01  |  54.6 KB  |  3,966 lines

  1. 1{SHIFT-+}1z{SHIFT-+}1z
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                             PREFACE 
  19.        -------------------------------------------------- 
  20.  
  21.      There are several BASIC extension programs available, and in
  22. my opinion, they all share a common problem.   Once  your program
  23. is written,  it will only work if the extension program is loaded
  24. first.  Worse, you can't SHARE your programs unless everyone owns
  25. the same  BASIC extension  that you own.  It was this shortcoming
  26. that prompted me to write BASIC 4.  What makes  BASIC 4 different
  27. is  that   it  attaches   itself  to  your  BASIC  program,  thus
  28. eliminating the problems mentioned  above.   Now you  can use the
  29. full  power  of  BASIC  4  in  all  of  your programs, and freely
  30. distribute them to anyone.    By  the  way,  you  won't  find any
  31. programmer helper (i.e. RENUMBER, AUTO etc.) routines in BASIC 4.
  32. Every function and command is designed to help  you write faster,
  33. more efficient code.  I am especially proud of the array handling
  34. features.   Now you  can quickly  search and  sort string arrays,
  35. insert  and  delete  array  elements, and instantly sum an entire
  36. numeric array!
  37.  
  38.      Several new  commands allow  greater control  over your text
  39. screens.  The SCREEN command will let you save or load screens to
  40. and from disk, or to and  from  several  buffers  located  in RAM
  41. under  ROM.    The  COPY,  MOVE  and  ERASE  commands offer a new
  42. dimension in screen manipulation.
  43.  
  44.      I could go on raving about BASIC 4,  but I  think you should
  45. turn the page and discover the power for yourself.
  46.  
  47.  
  48.  
  49.                                                    ...Rick Nash  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. {SHIFT-+}1z
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.        -------------------------------------------------- 
  83.                    U S I N G   B A S I C   4 
  84.        -------------------------------------------------- 
  85.  
  86.      A very important concept to grasp early on is how BASIC 4
  87. uses memory, and how it attaches itself to your program.  A
  88. typical session will be as follows: 
  89.  
  90.      1.    Load BASIC 4 with LOAD "BASIC 4",8 and type RUN.  Once
  91. you do, you're in the development mode.
  92.  
  93.      2.   You will see a title screen and  copyright notice.   At
  94. this point you can write your code as usual, except that you have
  95. access to all of the new features of BASIC 4. 
  96.  
  97.      3.   When you are satisfied with  your code,  issue a normal
  98. SAVE command to save your SOURCE code.  This is more compact than
  99. the CSAVE which saves BASIC 4 along with your program.  You MIGHT
  100. find it  convenient to  use the CSAVE option because then you can
  101. just LOAD your program  and RUN  it and  you've booted  both your
  102. program AND BASIC!
  103.  
  104.  
  105.      When you load A file that you've CSAVED and type list, you
  106. will only see the BASIC 4 title screen.  If you type RUN however,
  107. your program will run.  You'll have to break your program in
  108. order to edit it.
  109.  
  110.      Steps 1-3 can be repeated as many times as necessary so that
  111. you can develop your code at different sittings (as normal BASIC
  112. allows). 
  113.  
  114.      See appendix A for a memory map showing actual memory used
  115. by BASIC 4. 
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                               -ii-
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. {SHIFT-+}1z
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.        -------------------------------------------------- 
  155.                 U S E R   G U I D E   F O R M A T
  156.        -------------------------------------------------- 
  157.  
  158.      Each new command is listed on a separate page, and includes
  159. the following information: 
  160.  
  161.  
  162.  
  163.      1.  The token for each command.  Advanced programmers will
  164. find this information useful. 
  165.  
  166.      2.  The command type.  Either Function or Statement. 
  167.  
  168.      3.  The action.  A general description of the command. 
  169.  
  170.      4.  The syntax.  This section shows the syntax for proper
  171. operation.  Note that parameters are enclosed in <> for clarity. 
  172. Do not type these characters in your program. 
  173.  
  174.      5) An example.  A short demonstration of the command at
  175. work.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                               -iii-
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. {SHIFT-+}1z
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.             BASIC 4 USER'S GUIDE  TABLE OF CONTENTS 
  217.  
  218. --------------------------------------------------
  219. STATEMENTS         PAGE            FUNCTIONS         PAGE
  220.  
  221. ' (REM)             3              ASC()               3 
  222. @ (AT)              2              BPEEK()             4 
  223. BPOKE               5              CTRL                10 
  224. CLS                 6              CVF()               11 
  225. COLOR               7              CVI()               12 
  226. COPY                8              DEC()               13 
  227. CSAVE               9              DEEK()              14 
  228. DEFUSR              15             EXEC()              21 
  229. DELETE              16             HEX$()              23 
  230. DOKE                17             INLINE$()           26 
  231. DUP()               18             INSCR$()            27 
  232. ELSE                19             INSTR()             29    
  233. ERASE               20             KEY                 30 
  234. FILL                22             MKF$()              31 
  235. HOME                24             MKI$()              32 
  236. IF                  25             MOD()               33 
  237. INSERT()            28             PROMPT()            38 
  238. MOVE                34             QUOT()              39 
  239. ON                  35             SEARCH()            46 
  240. PAUSE               36             STRING$()           48 
  241. PDELAY              37             SUM()               49 
  242. RESTORE             40             VARPTR()            50 
  243. RVS                 41             XOR()               51 
  244. SCRATCH()           42             SCREEN()            43 
  245. SCROFF              44             SCRON               45 
  246. SORT()              47             MEMORY MAP          49
  247. SCAN CODES          53
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.                               -iv-
  260.  
  261.  
  262.  
  263.  
  264.  
  265. {SHIFT-+}1z
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.        BASIC 4 USER'S GUIDE                       ' (REM) 
  284.        -------------------------------------------------- 
  285.  
  286. Token:
  287.  
  288.  $CF - 207 
  289.  
  290. Type: 
  291.  
  292.      Statement. 
  293.  
  294. Action:  
  295.  
  296.      Shorthand notation for REMark. 
  297.  
  298. Syntax: 
  299.  
  300.      '  
  301. Example:  
  302.  
  303.  10 REM this is an old-fashioned remark.
  304.  20 'here is the new style!
  305.  30 'which do you prefer?
  306.  40 {SHIFT-+}... program continues here ...{SHIFT--} 
  307.  
  308. See Also:
  309.  REM (In your BASIC manual). 
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                -1-
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. {SHIFT-+}1z
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344. BASIC 4 USER'S GUIDE                  @ (PRINT AT) 
  345. -------------------------------------------------- 
  346.  
  347. Token:
  348.  $EF - 239 
  349.  
  350. Type:
  351.  Statement. 
  352.  
  353. Action:
  354.  
  355.      Moves cursor  to desired  screen location.  This function is
  356. used with the PRINT command like the TAB or SPC  commands. Screen
  357. locations can  be expressed  as ROW,COL or as a screen location 0
  358. to 999.  Like  TAB and  SPC, more  than one  @ can  be used  in a
  359. single print command. Multiple @'s in a single print command must
  360. be separated by a comma or semicolon. 
  361.  
  362. Syntax:
  363.  
  364.   PRINT@<screen pos>,<variable-list>
  365.   PRINT@(<row>, <col>),<variable-list> screen
  366.   pos = 0-999
  367.   row = 0-24
  368.   col = 0-39
  369.   var-list = normal PRINT command parameters. 
  370.  
  371. Example:
  372.  
  373.  10 CLS 20 PRINT@0,"THIS IS AT LOCATION 0"
  374.  30 PRINT@(10,10),"THIS IS 10,10"
  375.  40 P=780
  376.  50 PRINT@P,"780",@P+40,"820" 
  377.  
  378. See Also:
  379.  
  380.  PRINT, TAB and SPC in your BASIC manual. 
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.                                -2-
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397. {SHIFT-+}1z
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413. BASIC 4 USER'S GUIDE                           ASC 
  414. -------------------------------------------------- 
  415.  
  416. Token: 
  417.  
  418.      $F8 - 248 
  419.  
  420. Type:
  421.  
  422.  Function. 
  423.  
  424. Action:
  425.  
  426.      This function works  exactly  like  the  ASC  in  your BASIC
  427. manual except that it fixes a bug in the original.  This ASC will
  428. return a 0 for a null character whereas the old  version produced
  429. an error message. 
  430.  
  431. Syntax:
  432.  
  433.  ASC(<string>)
  434.  string = ascii character 
  435.  
  436. Example:
  437.  
  438.  10 A$=""
  439.  20 A = ASC(A$)
  440.  30 PRINT "THE ASCII VALUE OF A$ IS:";A 
  441.  
  442. See Also:
  443.  
  444.  ASC in your BASIC manual. 
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                -3-
  458.  
  459.  
  460.  
  461.  
  462.  
  463. {SHIFT-+}1z
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474. BASIC 4 USER'S GUIDE                         BPEEK 
  475. -------------------------------------------------- 
  476.  
  477. Token:
  478.  $EE - 238 
  479.  
  480. Type:
  481.  Function. 
  482.  
  483. Action:
  484.  
  485.      BPEEK (BANK  PEEK) returns  the value from RAM under any ROM
  486. or I/O  location.   This area  is   located from  $A000 to $FFFF.
  487. BPEEK  will  also    return  the  correct  value  from  any other
  488. location, but will be slower than  the normal  PEEK command. This
  489. function will  give you  access to the normally unused RAM areas.
  490. See BPOKE for the command to poke to these areas. 
  491.  
  492. Syntax:
  493.  
  494.  BPEEK(<memory location>)
  495.  memory location = 0-65535 
  496.  
  497. Example: 
  498.  
  499.  10 CLS
  500.  20 M=DEC("E000")
  501.  30 PRINT@(8,0),"ENTER YOUR NAME:"
  502.  40 A$=INLINE$(8,17,12)
  503.  50 IFA$=""THEN 30
  504.  60 FORI=1TOLEN(A$)
  505.  70 BPOKEM+(I-1),ASC(MID$(A$,I,1)):NEXT
  506.  80 CLS:FORI=1TOLEN(A$)
  507.  90 PRINTCHR$(BPEEK(M+(I-1)));:NEXT 
  508.  
  509.      This program prompts you for your  name, then  pokes it into
  510. the RAM  under ROM  at address  $E000. It then fetches your name,
  511. and displays it on the screen. 
  512.  
  513. See Also:
  514.  BPOKE, PEEK and POKE. 
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.                                -4-
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529. {SHIFT-+}1z
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541. BASIC 4 USER'S GUIDE                         BPOKE 
  542. -------------------------------------------------- 
  543.  
  544. Token:
  545.  $DC - 220 
  546.  
  547. Type:
  548.  Statement. 
  549.  
  550. Action:
  551.  
  552.      The BPOKE command will poke a value to RAM under the ROM and
  553. I/O  area  from  $A000  to  $FFFF. This command will also poke to
  554. normal ram, but will be slower than the normal POKE. 
  555.  
  556. Syntax:
  557.  
  558.  BPOKE <address>,<value>
  559.  address = 0-65535
  560.  value = 0-255 
  561.  
  562. Example:
  563.  
  564.  10 CLS
  565.  20 M=DEC("E000")
  566.  30 PRINT@(8,0),"ENTER YOUR NAME:"
  567.  40 A$=INLINE$(8,17,12)
  568.  50 IFA$=""THEN 30
  569.  60 FORI=1TOLEN(A$)
  570.  70 BPOKEM+(I-1),ASC(MID$(A$,I,1)):NEXT
  571.  80 CLS:FORI=1TOLEN(A$)
  572.  90 PRINTCHR$(BPEEK(M+(I-1)));:NEXT 
  573.  
  574.      This program prompts you for your  name, then  pokes it into
  575. the RAM  under ROM  at address  $E000. It then fetches your name,
  576. and displays it on the screen. 
  577.  
  578. See Also:
  579.  
  580.  BPEEK, POKE and PEEK. 
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                -5-
  590.  
  591.  
  592.  
  593.  
  594.  
  595. {SHIFT-+}1z
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615. BASIC 4 USER'S GUIDE                           CLS 
  616. -------------------------------------------------- 
  617.  
  618. Token:
  619.  $CE - 206 
  620.  
  621. Type:
  622.  Statement. 
  623.  
  624. Action:
  625.  
  626.      The CLS command simply clears the screen. This is equivalent
  627. to PRINT CHR$(147).
  628.  
  629. Syntax:
  630.  CLS 
  631.  
  632. Example:
  633.  
  634.  10 CLS
  635.  20 PRINT "NOTHIN' LIKE A CLEAN SCREEN!" 
  636.  
  637. See Also:
  638.  
  639.  HOME.
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                -6-
  656.  
  657.  
  658.  
  659.  
  660.  
  661. {SHIFT-+}1z
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674. BASIC 4 USER'S GUIDE                         COLOR 
  675. -------------------------------------------------- 
  676.  
  677. Token:
  678.  $D7 - 215 
  679.  
  680. Type:
  681.  Statement. 
  682.  
  683. Action:
  684.  
  685.      The  COLOR  command  provides  an easy way to control screen
  686. border, background and  character  colors.  Note  that  all three
  687. colors must be specified. 
  688.  
  689. Syntax:
  690.  COLOR <border>,<background>,<character>
  691.  border = 0-15
  692.  background = 0-15
  693.  character = 0-15 
  694.  
  695. Example:
  696.  10 A=PEEK(53280):B=PEEK(53281):C=PEEK(646)
  697.  20 FORI=0TO15
  698.  30 FORJ=0TO15:CLS
  699.  40 FORK=0TO15
  700.  50 COLOR I,J,K
  701.  60 PRINT STRING$(40,"*");
  702.  70 NEXT:FORL=1TO50:NEXT
  703.  80 NEXT:NEXT
  704.  90 CLS:COLOR A,B,C 
  705.  
  706.      This program  saves the current screen colors, then displays
  707. all combination of screen and  character  colors.  The  screen is
  708. then restored to the original colors. 
  709.  
  710. See Also:
  711.  FILL 
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                -7-
  722.  
  723.  
  724.  
  725.  
  726.  
  727. {SHIFT-+}1z
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742. BASIC 4 USER'S GUIDE                          COPY 
  743. -------------------------------------------------- 
  744.  
  745. Token:
  746.  $D3 - 211 
  747.  
  748. Type:
  749.  Statement. 
  750.  
  751. Action:
  752.  
  753.      The COPY command copies lines on the screen. Color memory is
  754. moved along with the characters. The original line is unchanged. 
  755.  
  756. Syntax:
  757.  
  758.  COPY <row a> TO <row b>
  759.  row a = source row (0-24).
  760.  row b = destination row (0-24). 
  761.  
  762. Example:
  763.  
  764.  10 CLS
  765.  20 PRINT STRING$(40,42)
  766.  30 PRINT@40,"*",@79,"*"
  767.  40 FORI=2TO23:COPY1TOI:NEXT
  768.  50 COPY 0TO24
  769.  60 PRINT@(8,12),"A QUICK BORDER!"
  770.  70 FORI=1TO5000:NEXT 
  771.  
  772. See Also:
  773.  
  774.  MOVE, ERASE, RVS AND FILL 
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.                                -8-
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793. {SHIFT-+}1z
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811. BASIC 4 USER'S GUIDE                         CSAVE 
  812. -------------------------------------------------- 
  813.  
  814. Token:  
  815.      $E6 - 230 
  816.  
  817. Type:
  818.  Statement. 
  819.  
  820. Action:
  821.  
  822.      The CSAVE command saves the runtime BASIC module  along with
  823. your source  code. This  combined package  will LOAD and RUN like
  824. any other BASIC program.  It  WILL  NOT  list  however.  For this
  825. reason, YOU MUST save your "source file" while in the development
  826. mode. Use the normal SAVE command  to do  this. Failure  to do so
  827. will result  in the  loss of  your work. Read the manual for more
  828. information. 
  829.  
  830. Syntax:
  831.  CSAVE "<filename>",<device number>,<sa> filename = the combined 
  832. program filename sa = optional secondary address 
  833.  
  834. Example:
  835.  CSAVE "THISFILE",8 
  836.  
  837.      This command  will  save  the  current  combined  program as
  838. THISFILE to the disk drive number 8.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.                                -9-
  854.  
  855.  
  856.  
  857.  
  858.  
  859. {SHIFT-+}1z
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872. BASIC 4 USER'S GUIDE                          CTRL 
  873. -------------------------------------------------- 
  874.  
  875. Token:
  876.  $FC - 252 
  877.  
  878. Type:
  879.  Function - system variable. 
  880.  
  881. Action:
  882.  
  883.      This function acts like a system variable (eg. TI$ ST etc.).
  884. It returns the current status of the SHIFT, CONTROL and COMMODORE
  885. keys. The values returned are as follows:
  886.  
  887.           1 - shift key  
  888.           2 - Commodore key  
  889.           4 - control key If more than one key is
  890.               pressed, the value returned will be                
  891.               the total of all keys pressed. 
  892.  
  893. Syntax:
  894.  CTRL 
  895.  
  896. Example:
  897.  
  898.  10 CLS
  899.  20 PRINT"PRESS COMMODORE F1 TO CONTINUE..."
  900.  30 IF (CTRL AND 2)=0THEN30
  901.  40 IF KEY <>4 THEN 30
  902.  50 POKE198,0 
  903.  
  904.      This program  waits for  the user to press the Commodore and
  905. F1 keys together before continuing the program. 
  906.  
  907. See Also:
  908.  KEY 
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.                               -10-
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925. {SHIFT-+}1z
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938. BASIC 4 USER'S GUIDE                           CVF 
  939. -------------------------------------------------- 
  940.  
  941. Token:
  942.  $F6 - 246 
  943.  
  944. Type:
  945.  Function. 
  946.  
  947. Action:
  948.  
  949.      The CVF function converts a four byte string into a floating
  950. point  value.  The  string,  must  have been produced by the MKF$
  951. function. Use these functions with care if you plan on using them
  952. with disk  files. Some  numbers will  convert to carriage returns
  953. which will mess up your sequential file. 
  954.  
  955. Syntax:
  956.  
  957.  CVF(<string>)
  958.  string = 4 byte string produced by MKF$ 
  959.  
  960. Example:
  961.  
  962.  10 CLS
  963.  20 A=56000.678
  964.  30 PRINT A:PRINT
  965.  40 A$=MKF$(A)
  966.  50 FORI=1TO4:PRINTASC(MID$(A$,I,1)):NEXT
  967.  60 PRINT:PRINTCVF(A$) 
  968.  
  969.      This program converts a  floating point  value in  a, into a
  970. four byte  string. It  then shows the contents of the string, and
  971. then converts the string back into a float again. 
  972.  
  973. See Also:
  974.  
  975.  CVI, MKI$ and MKF$ 
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.                               -11-
  986.  
  987.  
  988.  
  989.  
  990.  
  991. {SHIFT-+}1z
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005. BASIC 4 USER'S GUIDE                           CVI 
  1006. -------------------------------------------------- 
  1007.  
  1008. Token:
  1009.  
  1010.  $F5 - 245 
  1011.  
  1012. Type:
  1013.  
  1014.  Function. 
  1015.  
  1016. Action:
  1017.  
  1018.      Converts a two byte string into an integer.  The string must
  1019. have been previously converted via the MKI$ function. See CVF for
  1020. warnings on using the conversion commands in disk files. 
  1021.  
  1022. Syntax:
  1023.   
  1024.      CVI(<string>) 
  1025.  
  1026. Example:
  1027.  
  1028.  10 CLS
  1029.  20 PRINT "ORIGINAL",@16,+"CONVERTED"
  1030.  30 FORI=0TO10:READ D
  1031.  40 PRINT@(I+2,0),D:A$(I)=MKI$(D):NEXT
  1032.  50 FORI=0TO10
  1033.  60 PRINT@(I+2,18),CVI(A$(I)):NEXT
  1034.  70 DATA -50,2000,28765,-3897,1024,14
  1035.  80 DATA -4,32438,1798,290,2368 
  1036.  
  1037. See Also:
  1038.  
  1039.  CVF, MKI$ and MKF$  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.                               -12-
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. {SHIFT-+}1z
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071. BASIC 4 USER'S GUIDE                           DEC 
  1072. -------------------------------------------------- 
  1073.  
  1074. Token:
  1075.  
  1076.  $FD - 253 
  1077.  
  1078. Type:
  1079.  
  1080.  Function. 
  1081.  
  1082. Action:
  1083.  
  1084.      Converts a  hexadecimal ASCII  string into  a floating point
  1085. value. The  upper limit is approximately 2FFFFFFF. Larger numbers
  1086. may work, but will be returned as scientific notation. If non-hex
  1087. characters are  included in the string, DEC will return the total
  1088. until the first non-hex character. For example, DEC("FAXYZ") will
  1089. return 250 ($FA = 250).
  1090.  
  1091. Syntax:
  1092.  
  1093.  DEC(<string>)
  1094.  string = valid hex ASCII characters (0-9, A-F) 
  1095.  
  1096. Example:
  1097.  
  1098.  10 CLS
  1099.  20 A=DEC("E473")
  1100.  30 P=PEEK(A):A=A+1
  1101.  40 IFP=0 THEN END
  1102.  50 PRINTCHR$(P);:GOTO 30 
  1103.  
  1104. See Also:
  1105.  HEX$ 
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.                               -13-
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123. {SHIFT-+}1z
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134. BASIC 4 USER'S GUIDE                          DEEK 
  1135. -------------------------------------------------- 
  1136.  
  1137. Token:
  1138.  
  1139.  $E8 - 232 
  1140.  
  1141. Type:
  1142.  
  1143.  Function. 
  1144.  
  1145. Action:
  1146.  
  1147.      DEEK (Double  PEEK) is  a 16 bit version of PEEK. It returns
  1148. the 16 bit value at address and address  +1. DEEK  is most useful
  1149. for reading system vectors. Using DEEK is the same as:     
  1150. PEEK(<address>)+PEEK(<address+1>)*256 
  1151.  
  1152. Syntax:
  1153.  
  1154.  DEEK(<address>)
  1155.  address = 0-65534 
  1156.  
  1157. Example:
  1158.  
  1159.  10 CLS
  1160.  20 A=DEC("0314")
  1161.  30 READ D$:IFD$="END" THEN END
  1162.  40 PRINT D$,TAB(10)RIGHT$(HEX$(DEEK(A)),4)
  1163.  50 A=A+2:GOTO 30
  1164.  60 DATA IRQ,BRK,NMI,OPEN,CLOSE,CHKIN
  1165.  70 DATA CKOUT,CLRCH,CHRIN,CHROUT,STOP
  1166.  80 DATA GETIN,CLALL,USER,LOAD,SAVE
  1167.  90 DATA END 
  1168.  
  1169.      This program uses DEEK to print the low memory vectors in
  1170. the Commodore 64. 
  1171.  
  1172. See Also:
  1173.  
  1174.      DOKE, PEEK, POKE, BPEEK and BPOKE. 
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.                               -14-
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189. {SHIFT-+}1z
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201. BASIC 4 USER'S GUIDE                        DEFUSR 
  1202. -------------------------------------------------- 
  1203.  
  1204. Token:
  1205.  
  1206.  $D8 - 216 
  1207.  
  1208. Type:
  1209.  
  1210.  Statement. 
  1211.  
  1212. Action:
  1213.  
  1214.      The  DEFUSR  command  sets  up  the  USR  vector  at address
  1215. 785-786. It is equivalent to: DOKE 785,<address>
  1216.   
  1217. Syntax:
  1218.  
  1219.  DEFUSR(<address>)
  1220.  address = address of machine language routine. 
  1221.  
  1222. Example:
  1223.  
  1224.  10 CLS
  1225.  20 FORI=49152TO49155
  1226.  30 READ D:POKEI,D:NEXT
  1227.  40 DEFUSR(49152)
  1228.  50 PRINT "50 TIMES 10 IS"USR(50)
  1229.  60 END
  1230.  70 DATA 32,226,186  :'JSR $BAE2  ;FAC1=FAC1*10
  1231.  80 DATA 96          :'RTS        ;RETURN TO BASIC 
  1232.  
  1233.      This  program  sets  up  a  small  ML  program  that  simply
  1234. multiplies the  number passed to it by 10. The result is returned
  1235. to the BASIC program.  See  USR  in  your  BASIC  guide  for more
  1236. information. 
  1237.  
  1238. See Also:
  1239.  
  1240.  USR (in your basic guide).  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.                               -15-
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255. {SHIFT-+}1z
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265. BASIC 4 USER'S GUIDE                        DELETE
  1266. --------------------------------------------------- 
  1267.  
  1268. Token:
  1269.  
  1270.  $E1 - 225 
  1271.  
  1272. Type:
  1273.  
  1274.  Statement. 
  1275.  
  1276. Action:
  1277.  
  1278.      The  DELETE  command  physically  removes an element from an
  1279. array.   All   array   types   are   supported.   However,   only
  1280. singly-dimensioned  arrays  may  be  used  in the DELETE command.
  1281. After the element is deleted, the array is  shifted downward from
  1282. the top  of the array to the deleted element. The last element is
  1283. then cleared.
  1284.  
  1285. Syntax:
  1286.  
  1287.  DELETE (array(element))
  1288.  array = string, integer or float element = element          of
  1289. the array to delete 
  1290.  
  1291. Example:
  1292.  
  1293.  10 CLS:DIMA$(5)
  1294.  20 PRINT " BEFORE"TAB(10)"AFTER":PRINT
  1295.  30 FORI=0TO5:READA$(I)
  1296.  40 PRINT I,A$(I):NEXT
  1297.  50 DELETE(A$(3))
  1298.  60 FORI=0TO5
  1299.  70 PRINT@(I+2,9),I;A$(I):NEXT
  1300.  80 PRINT:PRINT"NOTE THAT ELEMENT 3 HAS BEEN  
  1301.     DELETED.
  1302.  90 DATA CAT,DOG,TREE,APPLE,FARM,BIRD 
  1303.  
  1304.      At line 50 we specified that element 3 of array  A$() was to
  1305. be deleted.  Note also that the last element (5 in this case) has
  1306. been cleared. 
  1307.  
  1308. See Also: DUP, INSERT, SCRATCH, SEARCH, SORT and SUM. 
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.                               -16-
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321. {SHIFT-+}1z
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335. BASIC 4 USER'S GUIDE                          DOKE 
  1336. -------------------------------------------------- 
  1337.  
  1338. Token:
  1339.  
  1340.  $D0 - 208 
  1341.  
  1342. Type:
  1343.  
  1344.  Statement. 
  1345.  
  1346. Action:
  1347.  
  1348.      Pokes a 16 bit value to  an  address  and  address+1  in the
  1349. standard 6502  notation (low  byte, high  byte). It is useful for
  1350. installing vectors. 
  1351.  
  1352. Syntax:
  1353.  
  1354.  DOKE <address>,<value>
  1355.  address = 0-65534
  1356.  value = 0-65535 
  1357.  
  1358. Example:
  1359.  
  1360.  10 CLS
  1361.  20 DOKE 828,49152
  1362.  30 PRINT DEEK(828) 
  1363.  
  1364.      This example places the 16 bit value 49152  at 828  and 829.
  1365. DEEK then reads and displays the 16 bit value. 
  1366.  
  1367. See Also: 
  1368.  
  1369.      DEEK, POKE, PEEK, BPOKE and BPEEK. 
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.                               -17-
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387. {SHIFT-+}1z
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. BASIC 4 USER'S GUIDE                           DUP 
  1397. -------------------------------------------------- 
  1398.  
  1399. Token:
  1400.  $E2 - 226 
  1401.  
  1402. Type:
  1403.  Statement. 
  1404.  
  1405. Action:
  1406.      DUP is  used to  fill (DUPlicate)  an entire  array with the
  1407. same value. Any type of array with any  amount of  dimensions can
  1408. be duplicated.  Set the  first element  in the array to the value
  1409. that you want to duplicate, then use DUP to copy it to  all other
  1410. elements in  the array.  Since string  arrays are pointers to the
  1411. actual text, only one  string is  produced, and  the entire array
  1412. points to it. 
  1413.  
  1414. Syntax:
  1415.  
  1416.  DUP(<array name>(0[,0]) array name = string, integer or float
  1417. array specify element 0 (all elements should be 0 if multiply
  1418. dimensioned) 
  1419.  
  1420. Example:
  1421.  
  1422.  10 DIM A$(20)
  1423.  20 DIM A%(3,3)
  1424.  30 DIMA(2,2,2)
  1425.  40 A$(0)="HELLO":DUP(A$(0))
  1426.  50 A%(0,0)=-22:DUP(A%(0,0))
  1427.  60 A(0,0,0)=176.93:DUP(A(0,0,0))
  1428.  70 CLS:FORI=0TO20:PRINTA$(I):NEXT
  1429.  80 GOSUB160
  1430.  90 CLS:FORI=0TO3:FORJ=0TO3
  1431.  100 PRINTA%(I,J),:NEXT:NEXT
  1432.  110 GOSUB160
  1433.  120 CLS:FORI=0TO2:FORJ=0TO2:FORK=0TO2
  1434.  130 PRINTA(I,J,K),:NEXT:NEXT:NEXT
  1435.  140 GOSUB160
  1436.  150 END
  1437.  160 A=PROMPT(24,10,"PRESS F1 TO CONTINUE", 
  1438.      CHR$(133)):RETURN 
  1439.  
  1440. See Also: 
  1441.      DELETE, INSERT, SCRATCH, SEARCH, SORT and SUM.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.                               -18-
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453. {SHIFT-+}1z
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467. BASIC 4 USER'S GUIDE                          ELSE 
  1468. -------------------------------------------------- 
  1469.  
  1470. Token:
  1471.  $CD - 205 
  1472.  
  1473. Type:
  1474.  Statement. 
  1475.  
  1476. Action:
  1477.  
  1478.      Provides alternate  action after  an IF-THEN  command in the
  1479. case that the IF  test  fails.  A  colon  must  precede  the ELSE
  1480. command.  Nested ELSE's are not supported. 
  1481.  
  1482. Syntax:
  1483.  
  1484.  IF <expression> THEN <statement> :ELSE <statement> 
  1485.      expression = test that evaluates to true or  
  1486.                   false.
  1487.  
  1488.  statement = a GOTO or line number, or other  
  1489.              legal BASIC command. 
  1490.  
  1491. Example:
  1492.  
  1493.  10 CLS
  1494.  20 A=50
  1495.  30 IF A=10 THEN 50:ELSE 60
  1496.  40 END
  1497.  50 PRINT"LINE 50":END
  1498.  60 PRINT"LINE 60":END 
  1499.  
  1500.      Since the test will fail in line 30, the program will branch
  1501. to line 60. 
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.                               -19-
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519. {SHIFT-+}1z
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528. BASIC 4 USER'S GUIDE                         ERASE 
  1529. -------------------------------------------------- 
  1530.  
  1531. Token:
  1532.  $D1 - 209 
  1533.  
  1534. Type:
  1535.  Statement. 
  1536.  
  1537. Action:
  1538.  
  1539.      The ERASE command erases a single, or range of lines on the
  1540. screen. 
  1541.  
  1542. Syntax:
  1543.  
  1544.  ERASE ERASE<row> ERASE<row a> TO <row b>
  1545.  
  1546.      row = 0-24 
  1547.      row a = source row (0-24).
  1548.      row b = destination row (0-24).
  1549.  
  1550. (The first syntax above will erase the line that the cursor is
  1551. on). 
  1552.  
  1553. Example:
  1554.  
  1555.  10 GOSUB90
  1556.  20 PRINT@120,"";:ERASE
  1557.  30 GOSUB110:GOSUB90
  1558.  40 FORI=0TO24STEP2:ERASEI:NEXT
  1559.  50 GOSUB110:GOSUB90
  1560.  60 ERASE6TO18
  1561.  70 GOSUB110:CLS
  1562.  80 END
  1563.  90 CLS:PRINTSTRING$(40,42)
  1564.  100 FORI=1TO24:COPY0TOI:NEXT
  1565.  110 FORI=1TO2000:NEXT:RETURN 
  1566.  
  1567.      This simple program demonstrates all three forms of the
  1568. ERASE command. 
  1569.  
  1570. See Also:
  1571.  
  1572.      COPY, MOVE, RVS and FILL 
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.                               -20-
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585. {SHIFT-+}1z
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595. BASIC 4 USER'S GUIDE                          EXEC 
  1596. -------------------------------------------------- 
  1597.  
  1598. Token:
  1599.  
  1600.  $FE - 254 
  1601.  
  1602. Type:
  1603.  
  1604.  Function. 
  1605.  
  1606. Action:
  1607.  
  1608.      This function may seem strange at first, but I'm sure you'll
  1609. find some interesting uses for it. It will execute a string as if
  1610. it were a line of BASIC code! Since this is a function, the BASIC
  1611. code must return a value. Commands such as  FOR-NEXT, GOTO, GOSUB
  1612. and  IF-THEN  will  not  work  inside  of an EXEC call. Functions
  1613. inside an EXEC call have access to variables in your program. 
  1614.  
  1615. Syntax:
  1616.  
  1617.  EXEC("<command>")
  1618.  command = any normal command that returns  
  1619.              a value. 
  1620.  
  1621.  Example:
  1622.  
  1623.  10 A$(0)="CHR$(A))
  1624.  20 A$(1)="ASC(A$))
  1625.  30 A=65
  1626.  40 A$=EXEC(A$(0))
  1627.  50 PRINT EXEC(A$(1)) 
  1628.  
  1629.      The two strings in  lines 10  and 20  are the  commands that
  1630. will execute. Line 30 sets variable A to 65. Line 40 executes the
  1631. first string which converts  the value  in A  into a  string, and
  1632. assigns  it  to  A$.  Line  50  executes  the second string which
  1633. converts the string value in A$ into an ASCII value which is then
  1634. displayed. Whew! I told you this was  strange!  
  1635.  
  1636. See Also: 
  1637.        (nothing else even comes close to this 
  1638.         one!)
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.                               -21-
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651. {SHIFT-+}1z
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660. BASIC 4 USER'S GUIDE                          FILL
  1661. --------------------------------------------------- 
  1662.  
  1663. Token:
  1664.  $D6 - 214 
  1665.  
  1666. Type:
  1667.  Statement. 
  1668.  
  1669. Action:
  1670.  
  1671.      The FILL command fills color memory on the entire, or
  1672. partial screen, with a specified color. 
  1673.  
  1674. Syntax:
  1675.  
  1676.  FILL<color> FILL<color>,<row>,<col>,<# bytes> 
  1677.  
  1678.      color = 0-15
  1679.      row = 0-24
  1680.      col = 0-39
  1681.      # bytes = 1-40 
  1682.  
  1683. Example:
  1684.  
  1685.  10 LN=0:COLOR15,15,6:CLS
  1686.  20 CH$=CHR$(145)+CHR$(17)+CHR$(13)
  1687.  30 GOSUB150:FORI=0TO10
  1688.  40 PRINT@(I+4,14),"CHOICE "+RIGHT$("   " 
  1689.     +MID$(STR$(I),2),2)
  1690.  50 NEXT
  1691.  60 FILL 1,LN+4,14,10
  1692.  70 ON KEY CH$; GOTO 90,100,110
  1693.  80 GOTO 70
  1694.  90 D=-1:GOTO120
  1695.  100 D=1:GOTO120
  1696.  110 PRINT@(17,8),"YOU SELECTED ITEM ";LN:END 
  1697.      120 FILL 6,LN+4,14,10:LN=LN+D:IFLN<0THENLN=10
  1698.  130 IF LN>10 THEN LN=0
  1699.  140 FILL 1,LN+4,14,10:GOTO70
  1700.  150 PRINT@(23,2),"USE UP AND DOWN ARROWS TO  
  1701.       CHOOSE":RVS23,0,40
  1702.  160 PRINT@(24,5),"AND PRESS RETURN TO  
  1703.        SELECT";:RVS24,0,40:RETURN 
  1704.  
  1705. See Also:
  1706.  MOVE, ERASE, RVS and COPY 
  1707.  
  1708.  
  1709.  
  1710.  
  1711.                               -22-
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717. {SHIFT-+}1z
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733. BASIC 4 USER'S GUIDE                          HEX$ 
  1734. -------------------------------------------------- 
  1735.  
  1736. Token:
  1737.  $F2 - 242 
  1738.  
  1739. Type:
  1740.  Function. 
  1741.  
  1742. Action:
  1743.  
  1744.      The  HEX$  function  converts  a floating point number to an
  1745. ASCII string. The string  has leading  zeros, so  you can extract
  1746. the  precision  you  need  with  the  RIGHT$ command. The maximum
  1747. number allowed is 2147483647 (or $7FFFFFFF). 
  1748.  
  1749. Syntax:
  1750.  
  1751.  HEX$(<number>)
  1752.  number = any whole number 0-2147483647 
  1753.  
  1754. Example:
  1755.  
  1756.  10 CLS
  1757.  20 PRINT"DEC   HEX":PRINT
  1758.  30 FORI=0TO15
  1759.  40 PRINTRIGHT$("  "+MID$(STR$(I),2),2);
  1760.  50 PRINTTAB(6);RIGHT$(HEX$(I),2)
  1761.  60 NEXT 
  1762.  
  1763. See Also:
  1764.  DEC. 
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.                               -23-
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783. {SHIFT-+}1z
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801. BASIC 4 USER'S GUIDE                          HOME 
  1802. -------------------------------------------------- 
  1803.  
  1804. Token:
  1805.  $E5 - 229 
  1806.  
  1807. Type:
  1808.  Statement. 
  1809.  
  1810. Action:
  1811.  
  1812.      HOME places the cursor at row 0, col 0. It is the same as
  1813. PRINT CHR$(19). 
  1814.  
  1815. Syntax:
  1816.  
  1817.  HOME 
  1818.  
  1819. Example:
  1820.  
  1821.  10 HOME
  1822.  20 PRINT"WELCOME HOME!" 
  1823.  
  1824.      This example prints a message at the HOME position. 
  1825.  
  1826. See Also: 
  1827.      CLS and PRINT@. 
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.                               -24-
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849. {SHIFT-+}1z
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874. BASIC 4 USER'S GUIDE                            IF 
  1875. -------------------------------------------------- 
  1876.  
  1877. Token:
  1878.  $CC - 204 
  1879.  
  1880. Type:
  1881.  Statement. 
  1882.  
  1883. Action:
  1884.  
  1885.      The IF command has been upgraded to allow  the optional ELSE
  1886. command. It  is included  in this manual because the token number
  1887. has been changed. See ELSE for more information.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                               -25-
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915. {SHIFT-+}1z
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929. BASIC 4 USER'S GUIDE                       INLINE$ 
  1930. -------------------------------------------------- 
  1931.  
  1932. Token:
  1933.  $FB - 251 
  1934.  
  1935. Type:
  1936.  Function. 
  1937.  
  1938. Action:
  1939.  
  1940.      The INLINE$ (INput  LINE)  function,  works  like  the INPUT
  1941. command, except  that you  can specify the starting position, and
  1942. the  maximum  number  of  characters  to  accept.  The  only keys
  1943. accepted  are  the  ASCII  characters 32-95 inclusive, the delete
  1944. key, the return and stop keys. 
  1945.  
  1946. Syntax:
  1947.  
  1948.  INLINE$(<row>,<col>,<# bytes>)
  1949.  row = 0-24
  1950.  col = 0-39
  1951.  # bytes = 1-255 
  1952.  
  1953. Example:
  1954.  
  1955.  10 CLS
  1956.  20 PRINT@(8,0),"ENTER YOUR NAME:"
  1957.  30 A$=INLINE$(8,17,20)
  1958.  40 CLS:N=(40-LEN(A$))/2
  1959.  50 FORI=0TO6:PRINT@(I,N),A$;:NEXT
  1960.  60 FORI=1TO1000:FILL MOD(I,16),MOD(I,7),0,40
  1961.  70 NEXT 
  1962.  
  1963. See Also:
  1964.  INPUT. 
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.                               -26-
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. {SHIFT-+}1z
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995. BASIC 4 USER'S GUIDE                        INSCR$ 
  1996. -------------------------------------------------- 
  1997.  
  1998. Token:
  1999.  $EC - 236 
  2000.  
  2001. Type:
  2002.  Function. 
  2003.  
  2004. Action:
  2005.  
  2006.      The INSCR$ (INput from  SCReen) command  reads data directly
  2007. from the  screen, and  places it  in a string variable. The bytes
  2008. are  converted  from  screen  codes  to  ASCII  codes  during the
  2009. transfer. 
  2010.  
  2011. Syntax:
  2012.  
  2013.  INSCR(<row>,<col>,<# bytes>)
  2014.  
  2015.      row = 0-24 
  2016.      col = 0-39 
  2017.      # bytes = 1-40 
  2018.  
  2019. Example:
  2020.  10 DIMA$(23)
  2021.  20 FORI=0TO23:A$(I)=INSCR$(I,0,40):NEXT 
  2022.  30 CLS:PAUSE20
  2023.  40 FORI=0TO23:PRINTA$(I);:NEXT
  2024.  50 PAUSE50 
  2025.  
  2026.      This program  reads the screen (except the last line) into a
  2027. string array. The screen is erased, and after a short  delay, the
  2028. screen is  replaced. (See  the SCREEN command for a better way to
  2029. deal with screen swapping). 
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.                               -27-
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047. {SHIFT-+}1z
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056. BASIC 4 USER'S GUIDE                        INSERT 
  2057. -------------------------------------------------- 
  2058.  
  2059. Token:
  2060.  $E0 - 224 
  2061.  
  2062. Type:
  2063.  Statement. 
  2064.  
  2065. Action:
  2066.  
  2067.      INSERT is used to  insert a  blank element  at the specified
  2068. subscript  in  an  array.  All singly dimensioned array types are
  2069. supported. All elements from the specified  subscript to  the top
  2070. of the  array are  moved up  one position  in the  array. The top
  2071. element is lost, and  the  specified  element  is  cleared. Note:
  2072. because the  top element  is always lost, make sure your array is
  2073. larger than it needs to be. 
  2074.  
  2075. Syntax:
  2076.  
  2077.  INSERT(<array>(<subscript>))
  2078.  
  2079.  array = String, float or integer array 
  2080.  
  2081. Example:
  2082.  
  2083.  10 CLS:DIMA$(10)
  2084.  20 DATA FLOPPY DISK, COMPUTER, PRINTER
  2085.  30 DATA MODEM, SOFTWARE, BYTE
  2086.  40 FORI=0TO5:READ A$(I):NEXT
  2087.  50 PRINT"BEFORE";TAB(20);"AFTER"
  2088.  60 FORI=0TO10
  2089.  70 PRINT@(I+2,0),RIGHT$("  "+MID$(STR$(I),2),2); 
  2090.  80 PRINT"  ";A$(I):NEXT
  2091.  90 INSERT(A$(2)):A$(2)=" *CHECK IT OUT!"
  2092.  100 INSERT(A$(4)):A$(4)=" *THIS IS NEW!" 
  2093.  110 FORI=0TO10 
  2094.  120 PRINT@(I+2,20),RIGHT$("  "+MID$(STR$(I),2),2);  130 PRINT" 
  2095. ";A$(I):NEXT 
  2096.  
  2097.      This inserts two new elements into an array and displays the
  2098. new array. 
  2099.  
  2100. See Also:
  2101.  DUP, DELETE, SCRATCH, SEARCH, SORT and SUM.
  2102.  
  2103.  
  2104.  
  2105.  
  2106.                               -28-
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113. {SHIFT-+}1z
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123. BASIC 4 USER'S GUIDE                         INSTR 
  2124. -------------------------------------------------- 
  2125.  
  2126. Token:
  2127.  $E7 - 231 
  2128.  
  2129. Type:
  2130.  Function. 
  2131.  
  2132. Action:
  2133.  
  2134.      The main  string is  searched to  see if it contains the sub
  2135. string. If it does, the position is returned, otherwise a zero is
  2136. returned. An  optional starting  position can be specified. If it
  2137. is not, then the  starting position  is assumed  to be  the first
  2138. character of the main string. 
  2139.  
  2140. Syntax:
  2141. INSTR([<pos>], <main string>, <sub string>)
  2142.  
  2143. pos = optional position to begin the search.
  2144. main string = the string to search.
  2145. sub string  = the key to search for. 
  2146.  
  2147.  10 CLS
  2148.  20 PRINT@(4,0),"PHONE:":Z$="(...) ...-...."
  2149.  30 ROW=4:COL=7:LN=14
  2150.  40 GOSUB 500:CLS:PRINT"YOU ENTERED "A$:END
  2151.  500 FLAG=0:CT=0:P=0:PRINT@(ROW,COL),Z$
  2152.  510 A=ASC(INSCR$(ROW,COL+P,1)):IF((P<LN)AND 
  2153.     (A<>46))THENP=P+1:GOTO510
  2154.  520 CT=CT+1:IFCT=20THENFLAG=XOR(FLAG,1):CT=0:RVS       
  2155. ROW,COL+P,1
  2156.  530 GETA$:IFA$=""THEN520
  2157.  540 IFINSTR("1234567890",A$)THEN 570 
  2158.  550 ONINSTR(CHR$(13)+CHR$(20),A$) GOTO 600,610
  2159.  560 GOTO 520
  2160.  570 IFP=LNTHEN 510 
  2161.  580 IFFLAG=1THENRVS ROW,COL+P,1
  2162.  590 PRINT@(ROW,COL+P),A$;:P=P+1:GOTO510
  2163.  600 A$=INSCR$(ROW,COL,LN):RETURN
  2164.  610 PRINT@(ROW,COL+P)," ";:GOTO500 
  2165.  
  2166.      This example prompts the user to enter a phone number. It
  2167. uses INSTR to accept only the number keys, or <RETURN> and <DEL>.
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.                               -29-
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179. {SHIFT-+}1z
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196. BASIC 4 USER'S GUIDE                           KEY 
  2197. -------------------------------------------------- 
  2198.  
  2199. Token:
  2200.  $F7 - 247 
  2201.  
  2202. Type:
  2203.  Function - system variable. 
  2204.  
  2205. Action:
  2206.  
  2207.      This  function  acts  like  a  system variable (i.e. TI$, ST
  2208. etc.). It returns the scan code  (not ASCII)  of the  current key
  2209. being  pressed.  This  function  is  the  same  as PEEK(203). See
  2210. appendix B  for a  list of  scan codes.  The ON  command has been
  2211. modified  to   recognize  the  KEY  function.  See  ON  for  more
  2212. information. 
  2213.  
  2214. Syntax: KEY 
  2215.  
  2216. Example:
  2217.  
  2218.  10 CLS
  2219.  20 PRINT "PRESS COMMODORE F1 TO CONTINUE..."
  2220.  30 IF (CTRL AND 2)=0THEN30
  2221.  40 IF KEY <> 4 THEN 30
  2222.  50 POKE198,0 
  2223.  
  2224. See Also:
  2225.  CTRL and ON. 
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.                               -30-
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245. {SHIFT-+}1z
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262. BASIC 4 USER'S GUIDE                          MKF$ 
  2263. -------------------------------------------------- 
  2264.  
  2265. Token:
  2266.  $F4 - 244 
  2267.  
  2268. Type:
  2269.  Function. 
  2270.  
  2271. Action:
  2272.  
  2273.      The MKF$ function converts a floating point value,  into a 4
  2274. byte string.  See CVF for warnings on using these strings in disk
  2275. files. 
  2276.  
  2277. Syntax:
  2278.  MKF$(<float>)
  2279.  float = any floating point value. 
  2280.  
  2281. Example:
  2282.  
  2283.  10 CLS
  2284.  20 A = 56000.678
  2285.  30 PRINT A:PRINT 
  2286.  40 A$=MKF$(A)
  2287.  50 FORI=1TO4:PRINTASC(MID$(A$,I,1)):NEXT
  2288.  60 PRINT:PRINTCVF(A$) 
  2289.  
  2290. See Also:
  2291.  CVF, MKI$ and CVI. 
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.                               -31-
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311. {SHIFT-+}1z
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327. BASIC 4 USER'S GUIDE                          MKI$ 
  2328. -------------------------------------------------- 
  2329.  
  2330. Token:
  2331.  $F3 - 243 
  2332.  
  2333. Type:
  2334.  Function. 
  2335.  
  2336. Action:
  2337.  
  2338.      The MKI$ converts any integer into a two byte string. See
  2339. CVF for warnings on using these strings in disk files. 
  2340.  
  2341. Syntax:
  2342.  
  2343.  MKI$(<integer>) 
  2344.  
  2345. Example:
  2346.  
  2347.  10 CLS:DIMA$(10)
  2348.  20 PRINT"ORIGINAL",@16,"CONVERTED"
  2349.  30 FORI=0TO10:READ D
  2350.  40 PRINT@(I+2,0),D:A$(I)=MKI$(D):NEXT
  2351.  50 FORI=0TO10
  2352.  60 PRINT@(I+2,18),CVI(A$(I)):NEXT
  2353.  70 DATA -50,2000,28765,-3897,1024,14
  2354.  80 DATA -4,32438,1798,290,2368 
  2355.  
  2356. See Also:
  2357.  
  2358.  MKF$, CVI and CVF. 
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.                               -32-
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377. {SHIFT-+}1z
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395. BASIC 4 USER'S GUIDE                           MOD 
  2396. -------------------------------------------------- 
  2397.  
  2398. Token:
  2399.  $F1 - 241 
  2400.  
  2401. Type:
  2402.  Function. 
  2403.  
  2404. Action:
  2405.  
  2406.      The MOD function returns the remainder of an integer
  2407. division.  
  2408.  
  2409. Syntax: 
  2410.  
  2411.      MOD(<integer a>, <integer b>)
  2412.  
  2413.  integer a = dividend.
  2414.  integer b = divisor. 
  2415.  
  2416. Example:
  2417.  
  2418.  10 CLS
  2419.  20 PRINT "THE REMAINDER OF 10 / 4 IS" MOD(10,4) 
  2420.  
  2421. See Also:
  2422.  QUOT. 
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.                               -33-
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443. {SHIFT-+}1z
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456. BASIC 4 USER'S GUIDE                          MOVE 
  2457. -------------------------------------------------- 
  2458.  
  2459. Token:
  2460.  $D4 - 212 
  2461.  
  2462. Type:
  2463.  Statement. 
  2464.  
  2465. Action:
  2466.  
  2467.      MOVE copies a screen row to another screen
  2468.  row. It then clears the original row.  
  2469.  
  2470. Syntax:
  2471.  
  2472.  MOVE <row a> TO <row b>
  2473.  
  2474.  row a = source row (0-24).
  2475.  row b = destination row (o-24). 
  2476.  
  2477. Example:
  2478.  
  2479.  10 CLS
  2480.  20 PRINT STRING$(40,"*");
  2481.  30 PRINT "**     MOVIN' RIGHT ALONG  **";
  2482.  40 PRINT STRING$(40,"*");:PAUSE10
  2483.  50 FORI=0TO21:MOVEI+2TOI+3:MOVEI+1TOI+2: 
  2484.     MOVEITOI+1:NEXT
  2485.  60 FORI=24TO3STEP-1:MOVEI-2TOI-3:MOVEI-1TO 
  2486.     I-2:MOVEITOI-1:NEXT
  2487.  70 PRINT@(5,3),"HOW'S THAT FOR A MOVING MESSAGE?" 
  2488.  
  2489.      This example prints a "moving message". Note that the string
  2490. in line 30 is 40 characters wide. 
  2491.  
  2492. See Also:
  2493.  
  2494.  COPY, ERASE, RVS and FILL.
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.                               -34-
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509. {SHIFT-+}1z
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523. BASIC 4 USER'S GUIDE                            ON 
  2524. -------------------------------------------------- 
  2525.  
  2526. Token:
  2527.  $DE - 222 
  2528.  
  2529. Type:
  2530.  Statement. 
  2531.  
  2532. Action:
  2533.  
  2534.      The ON command has been upgraded to work with the KEY
  2535. command. The ON command works as before, but now you can also
  2536. test for keystrokes. Please note the use of the semicolon in the
  2537. syntax. 
  2538.  
  2539. Syntax:
  2540.  
  2541. ON KEY <string> ; GOSUB / GOTO <linenumber>[,<linenumber>]...
  2542.  
  2543.      string = ASCII keys to match. 
  2544.  
  2545. Example:
  2546.  10 CLS:PRINT"PRESS A-D:"
  2547.  20 ON KEY "ABCD";GOTO 100,200,300,400
  2548.  30 GOTO 20
  2549.  100 PRINT"YOU PRESSED A":END
  2550.  200 PRINT"YOU PRESSED B":END
  2551.  300 PRINT"YOU PRESSED C":END
  2552.  400 PRINT"YOU PRESSED D":END 
  2553.  
  2554.      The example above waits for a key A-D  (as specified  in the
  2555. literal string).   When one is pressed, a message indicates which
  2556. key it was.  Note the semi- colon  in line  20.   You will  get a
  2557. syntax error without it. 
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.                               -35-
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575. {SHIFT-+}1z
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592. BASIC 4 USER'S GUIDE                         PAUSE 
  2593. -------------------------------------------------- 
  2594.  
  2595. Token:
  2596.  $D5 - 213 
  2597.  
  2598. Type:
  2599.  Statement. 
  2600.  
  2601. Action:
  2602.  
  2603.      The  PAUSE  command  causes  a  delay.  An  optional  number
  2604. specifies the duration (in 1/10 second increments). If  no number
  2605. is given,  then the  delay will continue until a the <RETURN> key
  2606. is pressed. Note that the <STOP> key is scanned during the delay,
  2607. so you can abort long delays. The 1/10 figure is approximate. 
  2608.  
  2609. Syntax:
  2610.  
  2611.  PAUSE [<num>]
  2612.  
  2613.  num = optional number of 1/10 seconds in the delay. 
  2614.  
  2615. Example:
  2616.  
  2617.  10 CLS
  2618.  20 PRINT "A 10 SECOND DELAY..."
  2619.  30 PAUSE120 
  2620.  40 PRINT "PAUSE UNTIL <RETURN> IS PRESSED..."
  2621.  50 PAUSE 
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.                               -36-
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641. {SHIFT-+}1z
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657. BASIC 4 USER'S GUIDE                        PDELAY 
  2658. -------------------------------------------------- 
  2659.  
  2660. Token:
  2661.  $D9 - 217 
  2662.  
  2663. Type: 
  2664.      Statement. 
  2665.  
  2666. Action:
  2667.  
  2668.      The  PDELAY  command  sets  the  blink  rate  for the PROMPT
  2669. command. If a PDELAY of 0 is specified,  then the  PROMPT command
  2670. will not blink. 
  2671.  
  2672. Syntax: 
  2673.  
  2674.      PDELAY <num> 
  2675.  
  2676.      num = blink rate (0-255).
  2677.      0 = no blink. 
  2678.  
  2679. Example:
  2680.  
  2681.      10 CLS 
  2682.      20 PDELAY 15 
  2683.      30 A=PROMPT(8,10,"CONTINUE? (Y/N)","YN") 
  2684.      40 IF CHR$(A)="N"THEN30 
  2685.  
  2686. See Also: 
  2687.      PROMPT. 
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.                               -37-
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707. {SHIFT-+}1z
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721. BASIC 4 USER'S GUIDE                        PROMPT 
  2722. -------------------------------------------------- 
  2723.  
  2724. Token: 
  2725.      $ED - 237 
  2726.  
  2727. Type: 
  2728.      Function. 
  2729.  
  2730. Action:
  2731.  
  2732.      The  PROMPT  command  will  display a message at a specified
  2733. location on the screen. PROMPT then  waits for  a key  press that
  2734. matches one  of the  characters in  the validation string. Once a
  2735. valid key is pressed, its ASCII value is  returned by  the PROMPT
  2736. function.
  2737.  
  2738. Syntax:
  2739.  
  2740.  PROMPT(<row>,<col>,<message>,<validation string>) 
  2741.  
  2742.      row = 0-24 
  2743.      col = 0-39 
  2744.      message = message to display 
  2745.      validation string = ASCII keys that are allowed, to cause
  2746. the program to resume. 
  2747.  
  2748. Example:
  2749.  
  2750.      10 CLS 
  2751.      20 PDELAY 15 
  2752.      30 A=PROMPT(8,10,"CONTINUE? (Y/N)","YN") 
  2753.      40 IF CHR$(A)="N"THEN30 
  2754.  
  2755. See Also: 
  2756.      PDELAY. 
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.                               -38-
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773. {SHIFT-+}1z
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791. BASIC 4 USER'S GUIDE                          QUOT 
  2792. -------------------------------------------------- 
  2793.  
  2794. Token: 
  2795.      $F0 - 240 
  2796.  
  2797. Type: 
  2798.      Function. 
  2799.  
  2800. Action:
  2801.  
  2802.      The  QUOT  function  returns  the  quotient  from an integer
  2803. division. The MOD function can be used to return the remainder. 
  2804.  
  2805. Syntax: 
  2806.      QUOT(<num a>, <num b>) 
  2807.      num a = dividend 
  2808.      num b = divisor 
  2809.  
  2810. Example:
  2811.  
  2812.      10 CLS 
  2813.      20 PRINT "100 DIVIDED BY 6 IS";QUOT(100,6) 
  2814.      30 PRINT 
  2815.      40 PRINT "WITH A REMAINDER OF";MOD(100,6) 
  2816.  
  2817. See Also: 
  2818.      MOD.
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.                               -39-
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839. {SHIFT-+}1z
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854. BASIC 4 USER'S GUIDE                       RESTORE 
  2855. -------------------------------------------------- 
  2856.  
  2857. Token: 
  2858.      $E4 - 228 
  2859.  
  2860. Type: 
  2861.      Statement. 
  2862.  
  2863. Action:
  2864.  
  2865.      The RESTORE works like the normal BASIC version, except that
  2866. you can  specify a line number to restore to. This feature allows
  2867. you to access DATA statements in any order that you wish.
  2868.  
  2869. Syntax: 
  2870.      RESTORE [<line number>] 
  2871.      line number = optional line to set DATA  
  2872.        pointer to. 
  2873.  
  2874. Example: 
  2875.      10 DATA SPECIFY THE LINE 
  2876.      20 DATA DATA POINTER TO BE SET TO. 
  2877.      30 DATA NOW YOU CAN 
  2878.      40 DATA THAT YOU WANT THE 
  2879.      50 CLS 
  2880.      60 RESTORE30:READD$:PRINTD$ 
  2881.      70 RESTORE10:READD$:PRINTD$ 
  2882.      80 RESTORE40:READD$:PRINTD$ 
  2883.      90 RESTORE20:READD$:PRINTD$ 
  2884.  
  2885. See Also:
  2886.  
  2887.      DATA and RESTORE in your BASIC manual.
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.                               -40-
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905. {SHIFT-+}1z
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913. BASIC 4 USER'S GUIDE                           RVS 
  2914. -------------------------------------------------- 
  2915.  
  2916. Token: 
  2917.      $D2 - 210 
  2918.  
  2919. Type: 
  2920.      Statement. 
  2921.  
  2922. Action:
  2923.  
  2924.      The RVS command will invert the characters on a specified
  2925. area of the screen. 
  2926.  
  2927. Syntax: 
  2928.      RVS <row>,<col>,<# chars> 
  2929.      row = 0-24 
  2930.      col = 0-39 
  2931.      # chars = 1-40 
  2932.  
  2933. Example: 
  2934.      10 LN=0:COLOR15,15,6:CLS 
  2935.      20 CH$=CHR$(145)+CHR$(17)+CHR$(13) 
  2936.      30 GOSUB150:FORI=0TO10 
  2937.      40 PRINT@(I+4,14),"CHOICE "+RIGHT$( 
  2938.         "  "+MID$(STR$(I),2),2) 
  2939.      50 NEXT 
  2940.      60 RVS LN+4,13,11 
  2941.      70 ON KEY CH$; GOTO 90,100,110 
  2942.      80 GOTO 70 
  2943.      90 D=-1:GOTO120 
  2944.      100 D=1:GOTO120 
  2945.      110 PRINT@(17,8),"YOU SELECTED ITEM ";LN:END 
  2946.      120 RVS LN+4,13,11:LN=LN+D:IFLN<0THENLN=10 
  2947.      130 IF LN>10 THEN LN=0 
  2948.      140 RVS LN+4,13,11:GOTO70 
  2949.      150 PRINT@(23,2),"USE UP AND DOWN ARROWS TO  
  2950.          CHOOSE":RVS23,0,40 
  2951.      160 PRINT@(24,5),"AND PRESS RETURN TO  
  2952.          SELECT";:RVS24,0,40:RETURN 
  2953.  
  2954.      This example uses the RVS command to make a nice "scrolling
  2955. bar" menu. 
  2956.  
  2957. See Also: 
  2958.  
  2959.      ERASE, MOVE, FILL and COPY. 
  2960.  
  2961.  
  2962.  
  2963.  
  2964.                               -41-
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971. {SHIFT-+}1z
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985. BASIC 4 USER'S GUIDE                       SCRATCH 
  2986. -------------------------------------------------- 
  2987.  
  2988. Token: 
  2989.      $E3 - 227 
  2990.  
  2991. Type: 
  2992.      Statement. 
  2993.  
  2994. Action:
  2995.  
  2996.      The SCRATCH command is used to  delete an  entire array, and
  2997. return  the  memory  back  to  the  system.  Think of the SCRATCH
  2998. command as kind of  an UN-DIM.  If the  array is  of type string,
  2999. then all strings are released from the string table. 
  3000.  
  3001. Syntax:
  3002.  
  3003.      SCRATCH(<array name>(0)) 
  3004.  
  3005.      array name = string, float or integer array. 
  3006.  
  3007. Example:
  3008.  
  3009.      10 CLS:PRINT"FREE MEMORY-":PRINT 
  3010.      20 PRINT"   BEFORE DIM:" 65535-FRE(0) 
  3011.      30 DIMA(200) 
  3012.      40 PRINT"    AFTER DIM:"65535-FRE(0) 
  3013.      50 SCRATCH(A(0)) 
  3014.      60 PRINT"AFTER SCRATCH:" 65535-FRE(0) 
  3015.      70 PRINT:PRINT "NOTE THAT ALL MEMORY HAS BEEN 
  3016.         RETURNED." 
  3017.  
  3018. See Also:
  3019.  
  3020.      DELETE, DUP, INSERT, SEARCH, SORT and SUM. 
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.                               -42-
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037. {SHIFT-+}1z
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047. BASIC 4 USER'S GUIDE                        SCREEN 
  3048. -------------------------------------------------- 
  3049.  
  3050. Token: 
  3051.      $DD - 221 
  3052.  
  3053. Type: 
  3054.      Statement. 
  3055.  
  3056. Action:
  3057.  
  3058.      The SCREEN  command is  used to  SAVE and  LOAD text screens
  3059. to/from disk. Screens can also be  saved and  loaded from  one of
  3060. four buffers  under the  KERNAL ROM.  When using the buffers, two
  3061. operations can be performed. Exchange will swap the  two screens.
  3062. Put will copy the source screen to the destination. 
  3063.  
  3064. Syntax:
  3065.  
  3066.      SCREEN(<operation>, <source>, <dest>)
  3067.  
  3068.        operation = E for exchange, P for put. 
  3069.        source = 0-4 (display is 0, buffers are 1-4)
  3070.        dest = 0-4 (display is 0, buffers are 1-4) 
  3071.   
  3072.  
  3073.      SCREEN(<operation>,<num>,<filename>)
  3074.  
  3075.        operation = S for save to disk, L for load. 
  3076.        num = source number for save, destination              for
  3077. load. 
  3078.        filename = any legal disk file name. 
  3079.  
  3080.      Note: num can be omitted from the disk load version.  In
  3081. that case, the screen is put into the same buffer number from
  3082. which it was saved. 
  3083.  
  3084. Example: 
  3085.      10 SCROFF:FORI=1TO4:CLS 
  3086.      20 PRINT@(I,8),"THIS IS SCREEN" I 
  3087.      25 PRINT:FORJ=1TO18:PRINTSTRING$(40,64+J);:NEXT 
  3088.      30 FILLI-1:SCREEN(P,0,I):NEXT:CLS:SCRON 
  3089.      40 FORI=1TO4:SCREEN(P,I,0):PAUSE60:NEXT 
  3090.     
  3091. This example stashes away 4 screens, then displays.
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.                               -43-
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103. {SHIFT-+}1z
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119. BASIC 4 USER'S GUIDE                        SCROFF 
  3120. -------------------------------------------------- 
  3121.  
  3122. Token: 
  3123.      $DB - 219 
  3124.  
  3125. Type: 
  3126.      Statement. 
  3127.  
  3128. Action:
  3129.  
  3130.      The  SCROFF  command  turns  off  the video display. This is
  3131. useful for  drawing screens  without the  user being  able to see
  3132. them  being  drawn.  Care  should  be taken so that errors do not
  3133. happen during a SCROFF, if they do, the error message will not be
  3134. seen!.  Press  RUN-STOP/RESTORE  to  restore normal video if this
  3135. happens. 
  3136.  
  3137. Syntax: 
  3138.      SCROFF 
  3139.  
  3140. Example: 
  3141.      10 SCROFF 
  3142.      20 CLS 
  3143.      30 PRINTSTRING$(80,"*"); 
  3144.      40 FORI=1TO14:PRINT"**"SPC(36)"**";:NEXT 
  3145.      50 PRINTSTRING$(80,"*"); 
  3146.      60 PRINT@(8,6),"THIS WILL APPEAR INSTANTLY!" 
  3147.      70 SCRON:PAUSE120 
  3148.  
  3149. See Also: 
  3150.      SCRON. 
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.                               -44-
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169. {SHIFT-+}1z
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186. BASIC 4 USER'S GUIDE                         SCRON 
  3187. -------------------------------------------------- 
  3188.  
  3189. Token: 
  3190.      $DA - 218 
  3191.  
  3192. Type: 
  3193.      Statement. 
  3194.  
  3195. Action:
  3196.  
  3197.      The SCRON command turns on the screen after SCROFF had been
  3198. used to turn it off. 
  3199.  
  3200. Syntax: 
  3201.      SCRON 
  3202.  
  3203. Example:
  3204.  
  3205.      10 SCROFF 
  3206.      20 CLS 
  3207.      30 PRINTSTRING$(80,"*"); 
  3208.      40 FORI=1TO14:PRINT"**"SPC(36)"**";:NEXT 
  3209.      50 PRINTSTRING$(80,"*"); 
  3210.      60 PRINT@(8,6),"THIS WILL APPEAR INSTANTLY!" 
  3211.      70 SCRON:PAUSE120 
  3212.  
  3213. See Also: 
  3214.  
  3215.      SCROFF. 
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.                               -45-
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235. {SHIFT-+}1z
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244. BASIC 4 USER'S GUIDE                        SEARCH 
  3245. -------------------------------------------------- 
  3246.  
  3247. Token: 
  3248.      $F9 - 249 
  3249.  
  3250. Type: 
  3251.      Function. 
  3252.  
  3253. Action:
  3254.  
  3255.      The SEARCH command is used to quickly search  a string array
  3256. for a  specified search key. The array can be searched in any one
  3257. of six different relational operations. If the key is found, then
  3258. SEARCH returns the element number of the match. If the key is not
  3259. found, then SEARCH returns -1. 
  3260.  
  3261. Syntax:
  3262.  
  3263.      SEARCH(<operator>, <array$(0)>, <key>) 
  3264.  
  3265.   operator:   1 = less than 
  3266.               2 = equal to 
  3267.               3 = less than or equal to 
  3268.               4 = greater than 
  3269.               5 = not equal to 
  3270.               6 = greater than or equal to 
  3271.   array = string array to be searched. 
  3272.   key = search key. 
  3273.  
  3274. Example:
  3275.      10 CLS:DIMA$(5):FORI=0TO5:READA$(I):NEXT 
  3276.      20 DATA ZEBRA,CAR,COMPUTER,RADIO,APPLE,TREE 
  3277.      30 FORI=0TO5:PRINTI,A$(I):NEXT 
  3278.      40 PRINT:PRINT 
  3279.      50 K$="TREE":GOSUB100 
  3280.      60 K$="CAR":GOSUB100 
  3281.      70 K$="AUTO":GOSUB100 
  3282.      80 END 
  3283.      100 S=SEARCH(2,A$(0),K$) 
  3284.      110 IFS>-1THENPRINTK$" WAS FOUND AT ELEMENT "S 
  3285.      120 IFS<0THENPRINTK$" WAS NOT FOUND" 
  3286.      130 RETURN 
  3287.  
  3288. See Also: 
  3289.      INSERT, DELETE, DUP, SCRATCH, SORT and SUM.
  3290.  
  3291.  
  3292.  
  3293.  
  3294.                               -46-
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301. {SHIFT-+}1z
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312. BASIC 4 USER'S GUIDE                          SORT 
  3313. -------------------------------------------------- 
  3314.  
  3315. Token: 
  3316.      $DF - 223 
  3317.  
  3318. Type: 
  3319.      Statement. 
  3320.  
  3321. Action:
  3322.  
  3323.      The SORT  command  is  used  to  sort  a  string  array into
  3324. ascending or  descending order. It uses the Shell Metzner sorting
  3325. algorithm. Note that element zero is not sorted. 
  3326.  
  3327. Syntax:
  3328.  
  3329.      SORT(<direction>, <array$(0)>)
  3330.  
  3331.      direction = A for ascending. 
  3332.                  D for descending 
  3333.      array = string array to sort. 
  3334.  
  3335. Example: 
  3336.  
  3337.      10 CLS:DIMA$(6):FORI=1TO6:READA$(I):NEXT 
  3338.      20 DATA RADIO,ZEBRA,COMPUTER,CAR,APPLE,TREE 
  3339.      30 PRINT"UNSORTED","ASCENDING","DESCENDING":
  3340.         PRINT 
  3341.      40 FORI=1TO6:PRINTA$(I):NEXT 
  3342.      50 SORT(A,A$(0)):PRINT@(2,0),""; 
  3343.      60 FORI=1TO6:PRINT ,A$(I):NEXT 
  3344.      70 SORT(D,A$(0)):PRINT@(2,0),""; 
  3345.      80 FORI=1TO6:PRINT ,,A$(I):NEXT 
  3346.  
  3347.      This simple program demonstrates the SORT  function. A small
  3348. array is  loaded with strings, it is then sorted in ascending and
  3349. descending order and displayed on the screen 
  3350.  
  3351. See Also: 
  3352.      INSERT, DELETE, DUP, SCRATCH, SEARCH and SUM. 
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.                               -47-
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367. {SHIFT-+}1z
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381. BASIC 4 USER'S GUIDE                       STRING$ 
  3382. -------------------------------------------------- 
  3383.  
  3384. Token: 
  3385.      $E9 - 233 
  3386.  
  3387. Type: 
  3388.      Function. 
  3389.  
  3390. Action:
  3391.  
  3392.      The STRING$ function returns a string of n copies of the
  3393. specified character (up to 255).  
  3394.  
  3395. Syntax:
  3396.  
  3397.      STRING$(<num>,<string>)
  3398.  
  3399.        num = number of copies 
  3400.        string = the character to copy 
  3401.     
  3402.      STRING$(<num>,<ASCII number>) 
  3403.  
  3404.        num = number of copies 
  3405.        ASCII number = ASCII value of desired  
  3406.                      character. 
  3407.  
  3408. Example:
  3409.  
  3410.      10 CLS:A$=CHR$(45) 
  3411.      20 PRINT STRING$(40,"-") 
  3412.      30 PRINT STRING$(40,45) 
  3413.      40 PRINT STRING$(40,A$) 
  3414.  
  3415.      This program demonstrates the several ways of passing the
  3416. string parameter to the STRING$ command.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.                               -48-
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433. {SHIFT-+}1z
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448. BASIC 4 USER'S GUIDE                           SUM 
  3449. -------------------------------------------------- 
  3450.  
  3451. Token: 
  3452.      $FA - 250 
  3453.  
  3454. Type: 
  3455.      Function. 
  3456.  
  3457. Action:
  3458.  
  3459.      The SUM function returns the sum of an entire numeric array.
  3460. The array must be floating point or integer. 
  3461.  
  3462. Syntax:
  3463.  
  3464.      SUM(<array>(0))
  3465.  
  3466.      array = an integer or float array. 
  3467.  
  3468. Example:
  3469.  
  3470.      10 CLS:DIM A(10) 
  3471.      20 DATA 500,299.60,53.80,40,20,1000, 
  3472.         67.3,666.23,123.48,87,200 
  3473.      30 FORI=0TO10:READ A(I):NEXT 
  3474.      40 PRINT"THE SUM OF:" 
  3475.      50 FORI=0TO10:PRINTTAB(10)A(I):NEXT 
  3476.      60 PRINTTAB(10)"----------" 
  3477.      70 PRINT  TAB(6)"IS: "SUM(A(0)) 
  3478.  
  3479. See Also: 
  3480.  
  3481.      INSERT, DELETE, DUP, SCRATCH, SEARCH and SORT.
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.                               -49-
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499. {SHIFT-+}1z
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513. BASIC 4 USER'S GUIDE                        VARPTR 
  3514. -------------------------------------------------- 
  3515.  
  3516. Token: 
  3517.      $EA - 234 
  3518.  
  3519. Type: 
  3520.      Function. 
  3521.  
  3522. Action:
  3523.  
  3524.      The  VARPTR  function  returns  the address of the specified
  3525. variable. Note that strings return a  pointer to  the string, and
  3526. its length.  For more  information on  variables and how they are
  3527. stored in memory, see TOOL KIT BASIC, by  Dan Heeb,  published by
  3528. COMPUTE!  BOOKS,  or  MASTERING  THE  COMMODORE  64  by  Jones  &
  3529. Carpenter, published by WILEY PRESS. 
  3530.  
  3531. Syntax:
  3532.  
  3533.      VARPTR(<variable>)
  3534.  
  3535.      variable = any legal BASIC variable.  
  3536.  
  3537. Example:
  3538.  
  3539.      10 CLS 
  3540.      20 DIM A$,A,B,I 
  3541.      30 A$="HERE IS A STRING!" 
  3542.      40 A = VARPTR(A$) 
  3543.      50 B = DEEK(A+1) 
  3544.      60 FORI=1TOPEEK(A):PRINTCHR$(PEEK(B+I-1));:
  3545.         NEXT 
  3546.  
  3547.      This example uses VARPTR to locate a string variable. The
  3548. string is then printed on the screen.
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.                               -50-
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565. {SHIFT-+}1z
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575. BASIC 4 USER'S GUIDE                           XOR 
  3576. -------------------------------------------------- 
  3577.  
  3578. Token: 
  3579.      $EB - 235 
  3580.  
  3581. Type: 
  3582.      Function. 
  3583.  
  3584. Action: 
  3585.      The  XOR   function   performs   the   bitwise  exclusive-or
  3586. operation.  Like  AND  or  OR,  XOR works on individual bits of a
  3587. byte. The following truth table explains:
  3588.  
  3589.          First Bit  Second Bit  Result 
  3590.         ------------------------------- 
  3591.            0           0         0 
  3592.            0           1         1 
  3593.            1           0         1 
  3594.            1           1         1        
  3595.         ------------------------------- 
  3596.  
  3597.      The XOR function is useful for flipping between two
  3598. characters, or flag conditions. 
  3599.  
  3600. Syntax: 
  3601.      XOR(<value>, <value>) 
  3602.      value = 0-32767 
  3603.  
  3604. Example: 
  3605.      10 CLS:F1=0:F2=0:A$(0)="ON ":A$(1)="OFF" 
  3606.      20 PRINT"YOU TYPE, AND I'LL PRINT THE CHARACTERS" 
  3607.      30 PRINT"ON THE SCREEN. IF YOU PRESS THE * KEY" 
  3608.      40 PRINT"I WON'T SHOW ANY CHARACTERS UNTIL YOU" 
  3609.      50 PRINT"PRESS THE * KEY AGAIN." 
  3610.      60 GETA$:IFA$=""THEN60 
  3611.      70 IFF1=0THENCLS:PRINT@36,A$(F2):F1=1 
  3612.      80 IFA$<>"*"THEN100:ELSE F2=XOR(F2,1): 
  3613.         POKE783,1:SYS65520 
  3614.      90 PRINT@36,A$(F2):POKE783,0:SYS65520:GOTO60 
  3615.      100 IFF2=1THEN60:ELSE PRINTA$;:GOTO 60 
  3616.  
  3617. See Also: 
  3618.      AND, OR and NOT in your BASIC manual.
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.                               -51-
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631. {SHIFT-+}1z
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659. BASIC 4 USER'S GUIDE                    APPENDIX A 
  3660. -------------------------------------------------- 
  3661.  
  3662.                            MEMORY MAP 
  3663.  
  3664. 00000 - $0000 = Start of RAM 
  3665. 02049 - $0801 = Start of Runtime module 
  3666. 06400 - $1900 = Approximate new start of BASIC 
  3667. 65535 - $FFFF = Top of RAM
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.                               -52-
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697. {SHIFT-+}1z
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709. BASIC 4 USER'S GUIDE                    APPENDIX B 
  3710. -------------------------------------------------- 
  3711.  
  3712.                            SCAN CODES 
  3713.  
  3714.       KEY               CODE            KEY          CODE  
  3715.     ------------------------------------------------------  
  3716.      INSERT/DELETE        0              9            32
  3717.      RETURN               1              I            33
  3718.      CURSOR RIGHT         2              J            34
  3719.      F7                   3              0            35
  3720.      F1                   4              M            36
  3721.      F3                   5              K            37
  3722.      F5                   6              O            38
  3723.      CURSOR DOWN          7              N            39
  3724.      3                    8              +            40
  3725.      W                    9              P            41
  3726.      A                   10              L            42
  3727.      4                   11              -            43
  3728.      Z                   12              .            44
  3729.      S                   13              :            45
  3730.      E                   14              @            46
  3731.      (NOT USED)          15              ,            47
  3732.      5                   16              BRITISH PND  48
  3733.      R                   17              *            49
  3734.      D                   18              ;            50
  3735.      6                   19              CLEAR/HOME   51
  3736.      C                   20              (NOT USED)   52
  3737.      F                   21              =            53
  3738.      T                   22              UP ARROW     54
  3739.      X                   23              /            55
  3740.      7                   24              1            56
  3741.      Y                   25              BACK ARROW   57
  3742.      G                   26              (NOT USED)   58
  3743.      8                   27              2            59
  3744.      B                   28              SPACE BAR    60
  3745.      H                   29              (NOT USED)   61
  3746.      U                   30              Q            62
  3747.      V                   31              RUN/STOP     63 
  3748.      NO KEY PRESSED      64  
  3749.      ------------------------------------------------------
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.                               -53-
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763. {SHIFT-+}1pc
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.                                 A D D E N D U M
  3770.  
  3771.  
  3772.                              R A S T E R   S Y N C
  3773.  
  3774.  
  3775.  
  3776.      BASIC 4 synchronizes certain commands with the raster line
  3777. on the screen.  What this means is that FILL, RVS, COPY, MOVE,
  3778. SCREEN, etc. won't write to the screen while it's still being
  3779. updated.  This makes screen manipulation look smoother at the
  3780. expense of printing to the screen seemingly slower.
  3781.  
  3782.      If you're constantly using BASIC 4 commands that manipulate
  3783. the screen, you might notice the decrease in speed. It might
  3784. sound hard to believe but those waits of up to a max 30th of a
  3785. second can add up to to notable intervals when nested in busy
  3786. screen manipulation loops.  If this isn't acceptable, you can
  3787. disable the wait.  To disable the raster wait, put this command
  3788. at the top of your program:
  3789.  
  3790.  
  3791. POKE 823,0:REM DISABLE RASTER WAIT
  3792.  
  3793.  
  3794.      Likewise you can enable the raster wait with the following:
  3795.  
  3796.  
  3797. POKE823,255:REM ENABLE RASTER WAIT
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.                      NEW BUT COMPATIBLE SYNTAX FOR INLINE$
  3836.  
  3837.  
  3838. Syntax:
  3839.  
  3840.      INLINE$(<row>,<col>,<#bytes>,[<validation string])
  3841.  
  3842.      The INLINE$ command now accepts upper/lowercase letters and
  3843. numbers as a default.  You can also specify which characters are
  3844. acceptable through an OPTIONAL validation string which can be
  3845. specified in quotes or through a string variable.  For instance:
  3846.  
  3847.  
  3848.      INLINE$(20,14,10,"1234567890.-")
  3849.  
  3850.  
  3851.      This will place a cursor at row 20, column 14 and allow only
  3852. 10 characters to be entered.  These ten characters are specified
  3853. in the validation string, "1234567890.-".  Only these characters
  3854. will be accepted.
  3855.  
  3856.      A null or absent validation string paramter will allow all
  3857. the default characters to be entered.
  3858.  
  3859.      The maximum number of characters allowed is 81.
  3860.  
  3861.  
  3862.      If you'd like a different type cursor to flash while INLINE$
  3863. is in use, POKE the ASCII value of the character you'd like to
  3864. flash in location 822.
  3865.  
  3866.      The maximum length of a validation string is 127.
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.                        D I S A B L I N G   B A S I C   4
  3904.  
  3905.  
  3906.  
  3907.      You can disable BASIC with a simple SYS 58451.
  3908.  
  3909.      This will make everything normal except the start of BASIC. 
  3910. Every command used after this MUST be BASIC V2.
  3911.  
  3912.  
  3913. Note: THAT THE START OF BASIC MUST BE MANUALLY MOVED BACK TO
  3914. $0801.
  3915.  
  3916.  
  3917.      SYS2214 will will do a warm start which will reset the
  3918. computer without killing fastloads.  BASIC pointers will be
  3919. normal but your program can't continue after this point since it
  3920. will be NEWed.  You are left in the immediate mode.
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.                                                                  
  3966.