home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 236 / 236.d81 / t.dbdocs0 < prev    next >
Encoding:
Text File  |  2004-01-01  |  8.4 KB  |  385 lines

  1. u
  2.            D O T B A S I C
  3.             (version 1.01)
  4.  
  5.               Program by
  6.       Dave Moorman and Lee Novak
  7.          Text by Dave Moorman
  8.  
  9.  
  10.     The more I use DotBASIC, the more
  11. power I find. Most of that power is
  12. the work of Lee Novak, who took the
  13. ideas of a mouse driver module
  14. and a screen effects toolbox and
  15. merged them into to the legendary Mr.
  16. Mouse.
  17.  
  18.     DotBASIC begins with Mr.Mouse, but
  19. adds incredible features of its own --
  20. not the least of which being Event
  21. Driven programming.
  22.  
  23.     The Dot Commands consist of a dot
  24. (period) and two characters. They are
  25. two characters long for two reasons.
  26. Two is better than one, and two
  27. characters correspond in memory to the
  28. two byte jump addresses they refer to.
  29. The method is quick! Just look up the
  30. name in one table, then use the index
  31. to point to the address in another
  32. matching table.
  33.  
  34.     One feature you have to remember
  35. is that when using a Dot Command after
  36. a THEN, put a colon in the way.
  37.  
  38.         IF A=5 THEN:.RK,40960
  39.  
  40.  
  41.     Here is the full documentation for
  42. DotBASIC Commands.
  43.  
  44.  
  45.   START: SYS 4608,med page
  46.   ------------------------
  47.  
  48.     This command is already done for
  49. your in the template program (the one
  50. given your PROGNAME.DOT when you begin
  51. programming. MED PAGE is the location
  52. where the .MED file was bloaded by the
  53. boot program -- normally page 224. You
  54. can modify the boot and load the .MED
  55. file anywhere you have 18 free pages.
  56. Just be sure this command points to
  57. your file.
  58.  
  59.  
  60.   STOP: SYS 4611
  61.   --------------
  62.  
  63.     This is exactly the same as the
  64. .OF command below. It is here, just in
  65. case.
  66.  
  67.  
  68. DO-LOOPING
  69. ----------
  70.  
  71.     Probably the single most powerful
  72. feature of DotBASIC is Do-Looping. I
  73. borrowed the code from Lothar Englisch
  74. who explained the technique in the
  75. 1984 Abacus book, [Advanced Machine]
  76. [Language Programming for the]
  77. [Commodre 64]. It uses ML methods that
  78. cannot be easily adapted to our
  79. favorite [SYS ADD, param] module
  80. structure -- hence the new command
  81. names.
  82.  
  83.     The program will loop between the
  84. .DO and the terminal comparison --
  85. either .UN or .WH, without having to
  86. hunt down line numbers as is the case
  87. with GOTO.
  88.  
  89.  
  90.   DO: .DO
  91.   -------
  92.  
  93.     Begins the Do-Loop. Do-Loops can
  94. be nested indefinitely (up to the
  95. capacity of the processor stack).
  96.  
  97.  
  98.   UNTIL: .UN comparison
  99.   ---------------------
  100.  
  101.     Note that there is [no comma]
  102. between the command and the parameter.
  103. This is a remnant of Lothar's code and
  104. I couldn't fix it.
  105.  
  106.     COMPARISON can be anything that
  107. has a value of either 0 or not 0.
  108.  
  109.        A>5, (Q>2 and Q<7), RG%
  110.  
  111.  I have learned to use variables as
  112. Boolean controls -- True or False --
  113. with False being 0 and True being not
  114. 0. So you will see in line 100:
  115.  
  116.       100 .DO:.EE:.WB:.UN E%:.OF
  117.  
  118.  were E% is 0 until acted upon by
  119. other code.
  120.  
  121.     UNTIL loops until the comparison
  122. is True.
  123.  
  124.  
  125.   WHILE: .WH comparison
  126.   ---------------------
  127.  
  128.     WHILE loops while the comparison
  129. is True.
  130.  
  131.  
  132.   DotBASIC OFF: .OF
  133.   -----------------
  134.  
  135.     This command turns off DotBASIC
  136. and puts all its toys away. The Dot
  137. Commands do not work after .OF has
  138. been executed. If you are putting
  139. STOPs in your code while debugging,
  140. include .OF first.
  141.  
  142.             4982 .OF:STOP
  143.  
  144.  
  145.   EVENT ENABLE: .EE
  146.   -----------------
  147.  
  148.     This is used in the Main Event
  149. Driver Loop -- line 100 -- and you
  150. will probably never need to use it in
  151. your own code. When an Event happens
  152. and the Event Handling code is called,
  153. the Event Driver is disabled (which
  154. keeps other Events from getting in the
  155. way). When the Event Handler is
  156. finished and RETURNs to the Main Loop,
  157. .EE is there to re-enable the Event
  158. Driver.
  159.  
  160.  
  161.   EVENT DISABLE: .ED
  162.   ------------------
  163.  
  164.     Allows you to disable the Event
  165. Driver. Useful when you want to do
  166. everything by hand, rather than use
  167. the Main Event Driver Loop as given.
  168. Also, you may have some set-up code
  169. that happens after DotBASIC is started
  170. and the Main Event Driver Loop. Use
  171. .ED so your set-up code will not be
  172. interrupted by an Event.
  173.  
  174.  
  175.   WAIT BACK ARROW: .WB
  176.   --------------------
  177.  
  178.     This command was also created for
  179. the Main Event Driver Loop. .WB
  180. watches the <BACK ARROW> key, and when
  181. the key is depressed, E% becomes -1.
  182. This then ends the loop.
  183.  
  184.  
  185.   YES/NO: .YN,x,y,u,h
  186.   -------------------
  187.  
  188.     Putting a simple Yes/No response
  189. in a dialog box can be a pain. But not
  190. anymore! Just use this command. X and
  191. Y are the screen coordinates. U is the
  192. unhighlighted (and box) color and H is
  193. the highlighted color.
  194.  
  195.     Use the add-on values shown in the
  196. BLOCK command to make the Yes and No
  197. change when highlighted or not. I find
  198. that +208 to each color gives a neat
  199. unreversed-when-pointed-to effect.
  200.  
  201.     The user's response is returned in
  202. I% -- No = 0, Yes = -1.
  203.  
  204.  
  205.   ARE YOU SURE: .RU,u,h
  206.   ---------------------
  207.  
  208.     This puts a nice dialog box in the
  209. center of the screen in the U color
  210. that asks, appropriately enough, Are
  211. Your Sure? The YES/NO command and the
  212. u and h colors work the same as above.
  213.  
  214.  
  215. STRING DATA
  216. -----------
  217.  
  218.     The RACK command (covered later in
  219. these docs) is powerful. You can BLOAD
  220. an Edstar text file (with a 0 byte at
  221. the end), do a RACK, and have the data
  222. become a virtual string array. The
  223. data can be anywhere in memory --
  224. under ROM or I/O -- and not occupy
  225. precious BASIC memory. With RACK
  226. INDEX, every string line can be
  227. accessed.
  228.  
  229.     This was too good to leave alone.
  230. So we added the String Data commands
  231. that allow you to put strings into
  232. memory for RACKing and INDEXing.
  233.  
  234.  
  235.   LOCATE STRING DATA: .$L,location
  236.   --------------------------------
  237.  
  238.     This must be done first, telling
  239. DotBASIC where in memory your string
  240. data will start.
  241.  
  242.  
  243.   PUT STRING DATA: .$P,string
  244.   ---------------------------
  245.  
  246.     This puts strings into the string
  247. data area, beginning at the location
  248. specified with .$L. Each string is
  249. ended with a 0 byte. The next string
  250. is put over the previous 0 byte. When
  251. finished, the data can be RACKed and
  252. INDEXed like an Edstar file.
  253.  
  254.  
  255.  
  256.   INSTRING: .$I,search$,target$
  257.   -----------------------------
  258.  
  259.  
  260.     Ever wanted to find out if one
  261. string of characters is contained in
  262. another string. You can certainly use
  263. a FOR-NEXT loop with MID$. But
  264. INSTRING does it at lightning ML
  265. speed. If found, the position of the
  266. first character of the search string
  267. contained in the target string is
  268. returned in I%. If not found, I%=0.
  269.  
  270.  
  271.   WAIT KEY: .WK
  272.   -------------
  273.  
  274.     Does the same as:
  275.  
  276.         10 GETZ$:IFZ$=""THEN10
  277.         20 I%=ASC(Z$)
  278.  
  279.  
  280.   IRQ SUSPEND: .QS
  281.   ----------------
  282.  
  283.     One should disable Sprites and IRQ
  284. interrupts during disk access. .QS
  285. does this for you, turning off the
  286. mouse and arrow.
  287.  
  288.  
  289.   IRQ RESTORE: .QR
  290.   ----------------
  291.  
  292.     Restores the mouse and arrow after
  293. a .QS and disk access.
  294.  
  295.  
  296.   SIGNED INTEGER TO +FLOATING PT:
  297.   .IU,value
  298.   -------------------------------
  299.  
  300.     Don't you hate it when a two-byte
  301. positive value, such as FRE(0) goes
  302. negative when reported to BASIC. A
  303. number of Mr.Mouse commands return
  304. information in signed integers that
  305. should be unsigned. So we added this
  306. command. VALUE is any value, -32768 to
  307. 32768. The two-byte positive value is
  308. returned in FP.
  309.  
  310.  
  311.   POKE TWO BYTES: .P2,location,value
  312.   ----------------------------------
  313.  
  314.     You can now poke a two-byte value
  315. into two bytes. For example, if you
  316. want to put the REGION DATA for your
  317. own region work at 50123, all you need
  318. to do is
  319.  
  320.              .p2,MV,50123
  321.  
  322.  This replaces
  323.  
  324.       POKE MV,203:POKE MV+1,195
  325.  
  326.  
  327.   GET TWO BYTE VALUE: .G2,location
  328.   --------------------------------
  329.  
  330.     A two-byte PEEK. .G2,MV returns
  331. PEEK(MV)+PEEK(MV+1)*256 in FP.
  332.  
  333.  
  334.   POKE ONE BYTE: .P1,location,byte
  335.   --------------------------------
  336.  
  337.     Talk about not necessary!
  338.  
  339.  
  340.   GET ONE BYTE: .G1,location
  341.   --------------------------
  342.  
  343.     This is a little more useful
  344. because the result is returned in I%.
  345.  
  346.  
  347.   TEXT COLOR:        .TX,color
  348.   BACKGROUND COLOR:  .BG,color
  349.   BORDER COLOR:      .BR,color
  350.   ----------------------------
  351.  
  352.     The three commands BASIC 2.0 left
  353. out when ported to the C-64 from
  354. monochrome PET. I have added [one]
  355. more feature for this release:
  356.  
  357.     For .TX,color add 128 to the color
  358. code for reverse text. As I was going
  359. through the Cookbook docs, I realized
  360. it was stupid to have to
  361.  
  362.         .BX,x1,x2,y1,y2,160,7
  363.         .TX,7
  364.    >>>> PRINT"<rev>";
  365.         .PC,y1+1,"This Is REVERSED"
  366.  
  367. every time one does a BOX. The code
  368. now will be
  369.  
  370.         .BX,x1,x2,y1,y2,160,7
  371.         .TX,7 + 128
  372.         .PC,y1+1,"This IS Reversed"
  373.  
  374. Now, that was easier, wasn't it?
  375.  
  376.  
  377.     The next three docs cover the
  378. Mr.Mouse commands and related Dot
  379. Commands. Don't forget to print out
  380. the DB Command Sheet for a three page
  381. reminder of the power of DotBASIC.
  382.  
  383.  DMM
  384.  
  385.  
  386.