home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / tipi / tipi.adr < prev    next >
Text File  |  1993-11-06  |  21KB  |  1,203 lines

  1. ABS
  2. Data   ( n -- abs(n) )
  3. String ( -- )
  4.  
  5. Replaces the top value on the data
  6. stack with its absolute value.
  7.  
  8. ASC
  9. Data   ( -- N )
  10. String ( A$ -- A$ )
  11.  
  12. Places a number N on the data
  13. stack, where N is the ASCII value
  14. of the first character of the
  15. string on the top of the string
  16. stack.
  17.  
  18. BEEP
  19. Data   ( -- )
  20. String ( -- )
  21.  
  22. Produces a short beep.
  23.  
  24. BEGIN 
  25. Data   ( -- )
  26. String ( -- )
  27.  
  28. Starts a BEGIN UNTIL loop.
  29. When TIPI encounters an UNTIL, it
  30. will branch back to the BEGIN
  31. if the value on the data stack is
  32. FALSE.
  33.  
  34. BYE
  35. Data   ( n -- )
  36. String ( -- )
  37.  
  38. Exits a TIPI program and returns
  39. to DOS. BYE returns the top value
  40. from the data stack as an error
  41. level to DOS.
  42.  
  43. CALL
  44. Data   ( -- )
  45. String ( program$ param$ -- )
  46. Return ( -- )
  47. Calls a DOS program (program$) with
  48. parameters given in param$. Sets
  49. ERROR to 255 if the call is
  50. unsuccessful. Otherwise ERROR is
  51. set to zero unless the called DOS
  52. program returns it's own error
  53. code.
  54.  
  55. CASE
  56. Data   ( -- )
  57. String ( -- )
  58.  
  59. Begins a CASE structure.
  60.  
  61. CASE$
  62. Data   ( -- )
  63. String ( -- )
  64.  
  65. Begins a CASE$ structure.
  66.  
  67. CHDIR
  68. Data   ( -- )
  69. String ( dir$ -- )
  70.  
  71. Changes the current DOS directory
  72. to the one specified by the top
  73. string on the string stack.
  74.  
  75. CHR$
  76. Data   ( N -- )
  77. String ( -- M$ )
  78.  
  79. CHR$ converts an integer N from
  80. the data stack to an ASCII
  81. character and places the single
  82. character string on the top of the
  83. string stack.
  84.  
  85. CLOSE
  86. Data   ( N -- )
  87. String ( -- )
  88.  
  89. Closes file N. N should be either
  90. a 1 or a 2.
  91.  
  92. CLS
  93. Data   ( -- )
  94. String ( -- )
  95.  
  96. Clears the screen and places the
  97. cursor in the upper left corner.
  98.  
  99. COLOR
  100. Data   ( Foreground Background -- )
  101. String ( -- )
  102.  
  103. Sets the foreground and background
  104. colors of the screen for
  105. subsequent prints. Colors are as
  106. follows: 0 Black, 1 Blue, 2 Green,
  107. 3 Cyan, 4 Red, 5 Magenta, 6 Brown,
  108. 7 Gray, 8 Dark Gray, 9 Lt. Blue,
  109. 10 Lt. Green, 11 Lt. Cyan,
  110. 12 Lt. Red, 13 Lt. Magenta,
  111. 14 Yellow, 15 White.
  112. Notes -- 
  113. 1) Background colors 8 to 15
  114. result in blinking text.
  115. 2) The COLOR command has no effect
  116. on the Atari Portfolio.
  117.  
  118. COLOR?
  119. Data   ( -- flag )
  120. String ( -- )
  121.  
  122. Returns TRUE if a color card is
  123. detected, FALSE if a monochrome
  124. card is detected
  125.  
  126. COLUMN
  127. Data   ( -- col )
  128. String ( -- )
  129.  
  130. Places the column of the current
  131. cursor position on the data stack.
  132.  
  133. COMMAND$
  134. Data   ( -- )
  135. String ( -- Command$ )
  136.  
  137. Places a string on the string
  138. stack consisting of what followed
  139. the word TIPI on the DOS command
  140. line when TIPI was invoked.
  141.  
  142. CONSOLE
  143. Data   ( -- 0 )
  144. String ( -- )
  145.  
  146. Places the constant 0 on the data
  147. stack. The CONSOLE instruction is
  148. used for clarity. For example, the
  149. sequence CONSOLE ISINPUT is much
  150. clearer than 0 ISINPUT.
  151.  
  152. CR
  153. Data   ( -- )
  154. String ( -- )
  155.  
  156. Sends a carriage return to the
  157. current output device.
  158.  
  159. CURRENT
  160. Data   ( -- -2 )
  161. String ( -- )
  162.  
  163. Places the constant -2 on the data
  164. stack. CURRENT is used for
  165. clarity. For example,
  166. 1 CURRENT FILEPOS is much clearer
  167. than 1 -2 FILEPOS.
  168.  
  169. CURSOR
  170. Data   ( N -- )
  171. String ( -- )
  172.  
  173. If N is zero, the cursor will be
  174. made invisible. If N is non-zero,
  175. the cursor will be made visible.
  176. WARNING! Don't execute a 1 CURSOR
  177. unless you have already executed
  178. at least one 0 CURSOR.
  179.  
  180. DATE$
  181. Data   ( -- )
  182. String ( -- D$ )
  183.  
  184. Places the current date on the
  185. string stack in the form
  186. "MM-DD-YYYY".
  187.  
  188. DEFARRAY
  189. Data   ( N -- )
  190. String ( -- )
  191.  
  192. Creates an integer array of N 
  193. elements. The word after DEFARRAY
  194. is used as the name of the array.
  195. For example, 10 DEFARRAY BOB would
  196. create a 10 element array named
  197. BOB. When using STORE or FETCH
  198. with ARRAY variables, you must
  199. precede the ARRAY name with a
  200. number indicating the element to
  201. which you are refering. 
  202. For example, 3 BOB FETCH will
  203. fetch the contents of the third
  204. element of BOB, while 77 5 BOB
  205. STORE will store the number 77 in
  206. the fifth element of BOB. TIPI has
  207. enough array space for a total of
  208. up to 1000 array elements in a
  209. TIPI program. TIPI also has a
  210. limit of 100 distinct named
  211. variables per program.
  212.  
  213. DEFAULT
  214. Data   ( n -- )
  215. String ( -- )
  216.  
  217. Used within a CASE structure to
  218. cover any cases not dealt with
  219. by previous OF clauses.
  220.  
  221. DEFAULT$
  222. Data   ( -- )
  223. String ( a$ -- )
  224.  
  225. Used within a CASE$ structure to
  226. cover any cases not dealt with
  227. by previous OF$ clauses.
  228.  
  229. DEFINE
  230. Data   ( -- )
  231. String ( -- )
  232.  
  233. DEFINE is used to define new TIPI
  234. instructions. The word following
  235. DEFINE is the name of the new TIPI
  236. instruction. Following this will
  237. be a sequence of TIPI instructions
  238. followed by the word ENDDEF. Once
  239. a new TIPI instruction has been
  240. defined, it may be used just like
  241. any of the built-in TIPI
  242. instuctions. For example,
  243. DEFINE SQUARED DUP * ENDDEF
  244. DEFINE CUBED DUP SQUARED * ENDDEF
  245. will create two new TIPI 
  246. instructions, SQUARED and CUBED
  247. which will respectively square and
  248. cube a value on the stack. Up to
  249. 100 new TIPI instuctions may be
  250. defined in a TIPI program.
  251.  
  252. DEFSEG
  253. Data   ( N -- )
  254. String ( -- )
  255.  
  256. DEFSEG is used to define the data
  257. segment used in subsequent PEEK
  258. and POKE instructions. If N is -1,
  259. the data segment will be set back
  260. to TIPI's default data segment
  261. address.
  262.  
  263. DEFSTR
  264. Data   ( -- )
  265. String ( -- )
  266.  
  267. Creates a new string variable. The
  268. word after DEFSTR is used as the
  269. name of the string. For example,
  270. DEFSTR MARY will create a new
  271. string variable called MARY. STORE
  272. and FETCH are used to place values
  273. into variables and retrieve them
  274. respectively.
  275.  
  276. DEFTABLE
  277. Data   ( -- )
  278. String ( -- )
  279.  
  280. Creates a new data table. The word
  281. after DEFTABLE is used as the
  282. name of the table. For example,
  283. DEFTABLE FRED will create a new
  284. table called FRED. Following the
  285. name will be a series of numbers or
  286. TIPI instructions followed by the
  287. instruction ENDTABLE. After a table
  288. has been defined, any instruction in
  289. the table may be executed by
  290. preceding the table name with the
  291. number of the instruction to
  292. execute. For example, 4 FRED would
  293. execute the fourth instruction in
  294. FRED.
  295.  
  296. DEFVAR
  297. Data   ( -- )
  298. String ( -- )
  299.  
  300. Creates a new numeric variable.
  301. The word after DEFVAR is used as
  302. the name of the variable. For
  303. example, DEFVAR HERB will create a
  304. new variable called HERB. STORE
  305. and FETCH are used to place values
  306. into variables and retrieve them
  307. respectively.
  308.  
  309. DEPTH
  310. Data   ( -- N )
  311. String ( -- )
  312.  
  313. Places N on the data stack, where
  314. N is the depth of the data stack.
  315.  
  316. DEPTH$
  317. Data   ( -- N )
  318. String ( -- )
  319.  
  320. Places N on the data stack, where
  321. N is the depth of the string stack.
  322.  
  323. DO
  324. Data   ( N -- )
  325. String ( -- )
  326.  
  327. Begins a DO loop. Processing 
  328. continues until a LOOP instruction is 
  329. encountered. The loop will be 
  330. executed N times.
  331.  
  332. DROP
  333. Data   ( N -- )
  334. String ( -- )
  335.  
  336. Removes the top value from the
  337. data stack.
  338.  
  339. DROP$
  340. Data   ( -- )
  341. String ( A$ -- )
  342.  
  343. Removes the top value from the
  344. string stack.
  345.  
  346. DUP
  347. Data   ( N -- N N )
  348. String ( -- )
  349.  
  350. Duplicates the top value on the
  351. data stack.
  352.  
  353. DUP$
  354. Data   ( -- )
  355. String ( A$ -- A$ A$ )
  356.  
  357. Duplicates the top value on the
  358. string stack.
  359.  
  360. ELSE
  361. Data   ( -- )
  362. String ( -- )
  363.  
  364. Used within IF ELSE ENDIF
  365. constructs.
  366.  
  367. ENDCASE
  368. Data   ( -- )
  369. String ( -- )
  370.  
  371. Ends a CASE structure.
  372.  
  373. ENDCASE$
  374. Data   ( -- )
  375. String ( -- )
  376.  
  377. Ends a CASE$ structure.
  378.  
  379. ENDDEF
  380. Data   ( -- )
  381. String ( -- )
  382.  
  383. Ends an instruction definition.
  384.  
  385. ENDIF
  386. Data   ( -- )
  387. String ( -- )
  388.  
  389. Ends an IF ELSE ENDIF construct.
  390.  
  391. ENDOF
  392. Data   ( -- )
  393. String ( -- )
  394.  
  395. Ends an OF clause in a CASE
  396. structure.
  397.  
  398. ENDOF$
  399. Data   ( -- )
  400. String ( -- )
  401.  
  402. Ends an OF$ clause in a CASE$
  403. structure.
  404.  
  405. ENDTABLE
  406. Data   ( -- )
  407. String ( -- )
  408.  
  409. Ends a table structure.
  410.  
  411. EOF
  412. Data   ( -- -1 )
  413. String ( -- )
  414.  
  415. Places the constant -1 on the data
  416. stack. EOF is used for clarity.
  417. For example, 1 EOF FILEPOS is much
  418. clearer than 1 -1 FILEPOS.
  419.  
  420. ERROR
  421. Data   ( -- n )
  422. String ( -- )
  423.  
  424. Places the number of the current
  425. error on the data stack.
  426.  
  427. EVAL
  428. Data   ( -- ? )
  429. String ( I$ -- ? )
  430.  
  431. Evaluates the instruction I$ from
  432. the string stack.
  433.  
  434. EXTENDED
  435. Data   ( -- n )
  436. String ( -- )
  437.  
  438. Returns the contents of the system
  439. variable EXTENDED. This is used in
  440. conjuction with INKEY$. Extended
  441. will be 0 if a "normal" key is
  442. pressed, 1 if an "extended" key is
  443. pressed.
  444.  
  445. FALSE
  446. Data   ( -- 0 )
  447. String ( -- )
  448.  
  449. Places the value of FALSE (0) on
  450. the top of the data stack.
  451.  
  452. FETCH
  453. Data   ( v -- x )
  454.           or
  455. String ( -- x$ )
  456.  
  457. Returns the contents of variable
  458. v. The type of v (numeric or
  459. string) determines if the contents
  460. of the fetch is placed on the data
  461. or the string stack.
  462.  
  463. FILEPOS
  464. Data   ( filenum action -- loc )
  465. String ( -- )
  466.  
  467. FILEPOS is used to position and
  468. read the value of a file pointer.
  469. The filenum is a previously opened
  470. file number (1 or 2) and the
  471. action is either EOF, CURRENT or a
  472. specific location. The number loc
  473. returned on the data stack is the
  474. location in the file where the
  475. next action will occur. EOF moves
  476. the pointer to the end of the
  477. file, CURRENT keeps it at its
  478. current position and any other
  479. number moves the pointer to that
  480. location in the file.
  481. NOTE: For FILEPOS to move a file
  482. pointer, the file should have been
  483. opened with the "R" option.
  484.  
  485. FIRSTFILE
  486. Data   ( -- )
  487. String ( filespec -- fname$ )
  488.  
  489. Finds the first file that matches
  490. filespec. Filespec follows the
  491. standard DOS wildcard rules (ie
  492. the filespec can contain "*" or
  493. "?" characters).
  494.  
  495. GETBYTE
  496. Data   ( filenum -- byte )
  497. String ( -- )
  498.  
  499. Gets a single byte from a file
  500. whose filenumber is filenum. The
  501. file must have been previously
  502. opened and filenum must be either
  503. 1 or 2.
  504.  
  505. GETDIR
  506. Data   ( num -- )
  507. String ( -- dir$ )
  508.  
  509. GETDIR is used to get the current
  510. directory. If num = 0 then GETDIR
  511. returns the directory of the
  512. current drive. If num is 1 GETDIR
  513. uses the A drive, 2 uses the B
  514. drive, etc. The directory returned
  515. does NOT contain the drive letter
  516. or the first "\". Thus, if the
  517. current directory is the root
  518. directory, 0 GETDIR will return
  519. a null string ("").
  520.  
  521. GETNUM
  522. Data   ( -- n )
  523. String ( -- )
  524.  
  525. Gets a number from the current
  526. input device.
  527.  
  528. GET$
  529. Data   ( -- )
  530. String ( -- string$ )
  531.  
  532. Gets a string from the current
  533. input device.
  534.  
  535. IF
  536. Data   ( n -- )
  537. String ( -- )
  538.  
  539. If n is non-zero, statements up to
  540. the next ELSE or ENDIF will be
  541. executed. If N is zero, statements
  542. up to the next ELSE or ENDIF will
  543. be skipped.
  544.  
  545. INDEX
  546. Data   ( -- INDEX )
  547. String ( -- )
  548.  
  549. Copies the current DO LOOP index
  550. value to the data stack.
  551.  
  552. INKEY$
  553. Data   ( -- )
  554. String ( -- k$ )
  555.  
  556. Scans the keyboard and returns a
  557. one character string. If no key is
  558. pressed, k$ is null (""),
  559. otherwise k$ is the character
  560. whose key was pressed. If an
  561. extended key was pressed, the
  562. system variable EXTENDED is set to
  563. TRUE.
  564.  
  565. INSTR
  566. Data   ( -- n )
  567. String ( a$ b$ -- a$ b$ )
  568.  
  569. Searches a$ for the first
  570. occurrence of b$. If b$ is in a$,
  571. n is the location where b$ starts
  572. in a$. If b$ is not in a$, n is
  573. zero.
  574.  
  575. ISINPUT
  576. Data   ( n -- )
  577. String ( -- )
  578.  
  579. Sets the current input device to
  580. n, where n is either file number 1
  581. or 2 or the CONSOLE. The CONSOLE
  582. is device 0.
  583.  
  584. ISOUTPUT
  585. Data   ( n -- )
  586. String ( -- )
  587.  
  588. Sets the current output device to
  589. n, where n is either file number 1
  590. or 2, the PRINTER or the CONSOLE.
  591. The CONSOLE is device 0 and the
  592. PRINTER is device 3.
  593.  
  594. KEY
  595. Data   ( -- k )
  596. String (  --  )
  597.  
  598. Scans the keyboard and returns a
  599. keycode. If no key is pressed, k
  600. is 0.
  601.  
  602. KILL
  603. Data   ( -- )
  604. String ( filespec$ -- )
  605.  
  606. Kills the specified file.
  607.  
  608. LCASE$
  609. Data   ( -- )
  610. String ( A$ -- a$ )
  611.  
  612. Converts any uppercase characters
  613. in A$ to lower case.
  614.  
  615. LEAVE
  616. Data   ( -- )
  617. String ( -- )
  618.  
  619. Sets the current INDEX value to
  620. one, thus ensuring the current DO
  621. LOOP will be ended on this
  622. itteration.
  623.  
  624. LEFT$
  625. Data   ( n -- )
  626. String ( a$ -- l$ )
  627.  
  628. Returns a string consisting of the
  629. n leftmost characters of a$. For
  630. example, "This is a test" 7 LEFT$
  631. would return "This is".
  632.  
  633. LEN
  634. Data   ( -- len )
  635. String ( a$ -- a$ )
  636.  
  637. Places the length of a$ on the
  638. data stack.
  639.  
  640. LF
  641. Data   ( -- )
  642. String ( -- )
  643.  
  644. Sends a line feed to the current
  645. output device.
  646.  
  647. LOCATE
  648. Data   ( row col -- )
  649. String ( -- )
  650.  
  651. Places the cursor at row, col.
  652.  
  653. LOOP
  654. Data   ( -- )
  655. String ( -- )
  656.  
  657. Closes a DO LOOP construct. 
  658. Decrements INDEX and loops back to
  659. the DO if INDEX > 0, otherwise exits
  660. the loop.
  661.  
  662. LTRIM$
  663. Data   ( -- )
  664. String ( a$ -- b$ )
  665.  
  666. Trims any leading blanks from a$.
  667.  
  668. MAKEDIR
  669. Data   ( -- )
  670. String ( dirspec$ -- )
  671.  
  672. Makes the directory specified in
  673. dirspec$. If there is an error,
  674. the system variable ERROR will be
  675. set.
  676.  
  677. MAX
  678. Data   ( A B -- MAX )
  679. String ( -- )
  680.  
  681. Places the greater of A or B
  682. on the data stack.
  683.  
  684. MID$
  685. Data   ( s l -- )
  686. String ( a$ -- b$ )
  687.  
  688. Returns b$, a string of l
  689. characters starting at position s
  690. from a$.
  691.  
  692. MIN
  693. Data   ( A B -- MIN )
  694. String ( -- )
  695.  
  696. Places the lesser of A or B
  697. on the data stack.
  698.  
  699. MOD
  700. Data   ( A B -- C )
  701. String ( -- )
  702.  
  703. Returns A modulo B.
  704.  
  705. MOUSE
  706. Data   ( AX BX CX DX -- AX BX CX DX )
  707. String ( -- )
  708.  
  709. Calls the low-level mouse interupt.
  710. See MOUSE.TPI for examples.
  711. Note: This instruction has no effect
  712. on the Atari Portfolio.
  713.  
  714. NEXTFILE
  715. Data   ( -- )
  716. String ( -- file$ )
  717.  
  718. Returns the next file that matches
  719. the filespec set by a previous
  720. FIRSTFILE command. If there are no
  721. more files matching the filespec,
  722. the null string ("") is returned.
  723.  
  724. NOT
  725. Data   ( n -- m )
  726. String ( -- )
  727.  
  728. Negates the truth value of a flag.
  729. If n is non-zero, m is zero. If n
  730. is zero, m is one.
  731.  
  732. OF
  733. Data   ( m n -- )
  734. String ( -- )
  735.  
  736. Must be used within a CASE
  737. structure. If m is equal to
  738. n, the instructions
  739. following the OF will be
  740. executed until an ENDOF is
  741. encountered.
  742.  
  743. OF$
  744. Data   ( -- )
  745. String ( a$ b$ -- )
  746.  
  747. Must be used within a CASE$
  748. structure. If a$ is equal to
  749. b$, the instructions
  750. following the OF$ will be
  751. executed until an ENDOF$ is
  752. encountered.
  753.  
  754. OFF
  755. Data   ( -- )
  756. String ( -- )
  757.  
  758. Shuts off an Atari Portfolio. OFF
  759. has no effect on a PC.
  760.  
  761. OPEN
  762. Data   ( N -- )
  763. String ( T$ F$ -- )
  764.  
  765. Opens a file. N is the file number
  766. and N may be either a 1 or a 2. T$
  767. is the type of open and T$ may be
  768. either "I", "O", "A" or "R" which
  769. stand for Input, Output, Append or
  770. Random respectively. F$ is the name
  771. of the file to open.
  772.  
  773. OVER
  774. Data   ( a b -- a b a )
  775. String ( -- )
  776.  
  777. Copies the second item on the data
  778. stack to the top.
  779.  
  780. OVER$
  781. Data   ( -- )
  782. String ( a$ b$ -- a$ b$ a $ )
  783.  
  784. Copies the second item on the data
  785. stack to the top.
  786.  
  787. PARSE$
  788. Data   ( -- )
  789. String ( TEXT$ -- NEWTEXT$ WORD$ )
  790.  
  791. Parses the first word from TEXT$.
  792.  
  793. PEEK
  794. Data   ( Addr -- Byte )
  795. String ( -- )
  796.  
  797. Places the contents of Addr on the
  798. stack. Addr is an address in the
  799. current segment. To change the
  800. current segment, use DEFSEG.
  801.  
  802. PICK
  803. Data   ( n -- m )
  804. String ( -- )
  805.  
  806. Places a copy of the nth item on
  807. the top of the data stack.
  808.  
  809. PICK$
  810. Data   ( n --  )
  811. String ( -- m$ )
  812.  
  813. Places a copy of the nth item on
  814. the top of the string stack.
  815.  
  816. POKE
  817. Data   ( Addr Byte -- )
  818. String ( -- )
  819.  
  820. Pokes Byte into Addr. Addr is an
  821. address in the current segment. To
  822. change the current segment, use
  823. DEFSEG.
  824.  
  825. POP
  826. Data   ( -- n )
  827. String ( -- )
  828.  
  829. Pops a value off the return stack.
  830.  
  831. PORT?
  832. Data   ( -- flag )
  833. String ( -- )
  834.  
  835. Returns TRUE if TIPI is running on
  836. an Atari Portfolio, FALSE
  837. otherwise.
  838.  
  839. PRINT
  840. Data   ( n -- )
  841. String ( -- )
  842.  
  843. Prints the number n on the current
  844. output device.
  845.  
  846. PRINTCHR
  847. Data   ( c -- )
  848. String ( -- )
  849.  
  850. Prints the character whose ASCII
  851. code is c on the current output
  852. device.
  853.  
  854. PRINTER
  855. Data   ( -- 3 )
  856. String ( -- )
  857.  
  858. Places the constant 3 on the data
  859. stack. The PRINTER instruction is
  860. used for clarity. For example, the
  861. sequence PRINTER ISOUTPUT is much
  862. clearer than 3 ISOUTPUT.
  863.  
  864. PRINT$
  865. Data   ( -- )
  866. String ( a$ -- )
  867.  
  868. Prints the string a$ on the
  869. current output device.
  870.  
  871. PUSH
  872. Data   ( n -- )
  873. String ( -- )
  874.  
  875. Pushes a value to the return stack.
  876.  
  877. PUTBYTE
  878. Data   ( B F -- )
  879. String ( -- )
  880.  
  881. Outputs byte B to file F.
  882.  
  883. RANDOM
  884. Data   ( N -- R )
  885. String ( -- )
  886.  
  887. Replaces N on the data stack with
  888. R, a random integer selected from
  889. the range 1 to N (inclusive).
  890.  
  891. RANDOMIZE
  892. Data   ( -- )
  893. String ( -- )
  894.  
  895. Initializes the random number
  896. generator.
  897.  
  898. REMDIR
  899. Data   ( -- )
  900. String ( dir$ -- )
  901.  
  902. Removes the directory dir$. The
  903. directory should be empty before
  904. you delete it. If REMDIR fails,
  905. the system variable ERROR will be
  906. set.
  907.  
  908. RENAME
  909. Data   ( -- )
  910. String ( oldname$ newname$ -- )
  911.  
  912. Renames a file.
  913.  
  914. REPLACE$
  915. Data   ( -- )
  916. String ( TEXT$ OLD$ NEW$ -- NEWTEXT$ )
  917.  
  918. Replaces any occurences of OLD$ in
  919. TEXT$ with NEW$.
  920.  
  921. RIGHT$
  922. Data   ( n -- )
  923. String ( A$ -- B$ )
  924.  
  925. Returns a string consisting of the
  926. n rightmost characters of a$. For
  927. example, "This is a test" 6 RIGHT$
  928. would return "a test".
  929.  
  930. ROT
  931. Data   ( A B C -- B C A )
  932. String ( -- )
  933.  
  934. Rotates the top three values on
  935. the data stack.
  936.  
  937. ROT$
  938. Data   ( -- )
  939. String ( a$ b$ c$ -- b$ c$ a$ )
  940.  
  941. Rotates the top three values on
  942. the string stack.
  943.  
  944. ROW
  945. Data   ( -- row )
  946. String ( -- )
  947.  
  948. Places the row of the current
  949. cursor position on the data stack.
  950.  
  951. RTRIM$
  952. Data   ( -- )
  953. String ( A$ -- B$ )
  954.  
  955. Removes any trailing blanks from
  956. A$.
  957.  
  958. SOUND
  959. Data   ( freq dur -- )
  960. String ( -- )
  961.  
  962. Plays a sound of a given freq and
  963. dur. 0 is the highest freq and 
  964. 32767 is the lowest.
  965.  
  966. STORE
  967. Data   ( n v -- )    ( v -- )
  968. String ( -- )     or ( s$ -- )
  969.  
  970. Stores a value into a variable.
  971. The type of v (numeric or string)
  972. determines if the contents of the
  973. store is taken from the data or
  974. the string stack.
  975.  
  976. STR$
  977. Data   ( N -- )
  978. String ( -- N$ )
  979.  
  980. Converts an integer from the data
  981. stack to a string. For example,
  982. 123 STR$ would place the string
  983. "123" on the string stack.
  984.  
  985. SWAP
  986. Data   ( A B -- B A )
  987. String ( -- )
  988.  
  989. Swaps the top two values on the
  990. data stack.
  991.  
  992. SWAP$
  993. Data   ( -- )
  994. String ( A$ B$ -- B$ A$ )
  995.  
  996. Swaps the top two values on the
  997. string stack.
  998.  
  999. TICKS
  1000. Data   ( -- t )
  1001. String ( -- )
  1002.  
  1003. Places the current PC tick count
  1004. on the data stack. A PC ticks
  1005. 18.2 times per second, while a
  1006. Portfolio ticks either once
  1007. every 128 seconds or once every
  1008. second.
  1009.  
  1010. TIME$
  1011. Data   ( -- )
  1012. String ( -- T$ )
  1013.  
  1014. Places the current time (in the
  1015. form "HH:MM:SS") on the string
  1016. stack.
  1017.  
  1018. TRACECOL
  1019. Data   ( col -- )
  1020. String ( -- )
  1021.  
  1022. Sets the column that the trace
  1023. window will be shown on.
  1024.  
  1025. TRACEOFF
  1026. Data   ( -- )
  1027. String ( -- )
  1028.  
  1029. Turns instruction tracing off
  1030.  
  1031. TRACEON
  1032. Data   ( -- )
  1033. String ( -- )
  1034.  
  1035. Turns word tracing on. When
  1036. instruction tracing is on, TIPI
  1037. displays an informational window
  1038. showing the stacks and the
  1039. instructions being executed.
  1040.  
  1041. TRACEROW
  1042. Data   ( row -- )
  1043. String ( -- )
  1044.  
  1045. Sets the row that the trace
  1046. window will be shown on.
  1047.  
  1048. TRACEVAR
  1049. Data   ( var -- )
  1050. String ( -- )
  1051.  
  1052. Adds a var to the trace window.
  1053.  
  1054. TRUE
  1055. Data   ( -- 1 )
  1056. String ( -- )
  1057.  
  1058. Places the constant 1 on the top
  1059. of the data stack.
  1060.  
  1061. UCASE$
  1062. Data   ( -- )
  1063. String ( a$ -- A$ )
  1064.  
  1065. Converts all the characters in a
  1066. string to uppercase.
  1067.  
  1068. UNTIL
  1069. Data   ( N -- )
  1070. String ( -- )
  1071.  
  1072. Branches back to BEGIN if N is
  1073. FALSE, otherwise continues.
  1074.  
  1075. VAL
  1076. Data   ( -- N )
  1077. String ( S$ -- )
  1078.  
  1079. Converts a string to a number.
  1080.  
  1081. VARPTR
  1082. Data   ( V -- A )
  1083. String ( -- )
  1084.  
  1085. Places the address of a variable
  1086. onto the data stack. This may be
  1087. used to PEEK and POKE values
  1088. directly into a variable.
  1089.  
  1090. VERSION
  1091. Data   ( -- N )
  1092. String ( -- )
  1093.  
  1094. VERSION leaves an integer N on
  1095. the data stack. N is equal to the
  1096. version number times ten (ie if N
  1097. is 23 then the TIPI version number
  1098. is 2.3).
  1099.  
  1100. WEND
  1101. Data   ( -- )
  1102. String ( -- )
  1103.  
  1104. WEND branches back to a previous
  1105. WHILE.
  1106.  
  1107. WHILE
  1108. Data   ( N -- )
  1109. String (  --  )
  1110.  
  1111. If N is not equal to zero,
  1112. instructions between the WHILE
  1113. and WEND will be executed. WEND
  1114. will branch back to the WHILE.
  1115. If N is equal to zero, the
  1116. instructions between the WHILE
  1117. and the WEND will will be skipped.
  1118.  
  1119. "
  1120. Data   ( -- )
  1121. String ( -- )
  1122.  
  1123. Begins and ends a text string.
  1124.  
  1125. #
  1126. Data   ( -- )
  1127. String ( -- )
  1128.  
  1129. Identifies a comment. Anything
  1130. after the # on a line is ignored.
  1131.  
  1132. (
  1133. Data   ( -- )
  1134. String ( -- )
  1135.  
  1136. Begins a comment.
  1137.  
  1138. )
  1139. Data   ( -- )
  1140. String ( -- )
  1141.  
  1142. Ends a comment.
  1143.  
  1144. *
  1145. Data   ( A B -- C )
  1146. String ( -- )
  1147.  
  1148. Multiplies A times B.
  1149.  
  1150. +
  1151. Data   ( A B -- C )
  1152. String ( -- )
  1153.  
  1154. Adds A and B.
  1155.  
  1156. +$
  1157. Data   ( -- )
  1158. String ( A$ B$ -- C$ )
  1159.  
  1160. Combines A$ and B$ into one
  1161. string.
  1162.  
  1163. -
  1164. Data   ( A B -- C )
  1165. String ( -- )
  1166.  
  1167. Subtracts B from A.
  1168.  
  1169. /
  1170. Data   ( A B -- C )
  1171. String ( -- )
  1172.  
  1173. Divides A by B.
  1174.  
  1175. <
  1176. Data   ( A B -- C )
  1177. String ( -- )
  1178.  
  1179. C is TRUE if A is less than B,
  1180. FALSE otherwise.
  1181.  
  1182. =
  1183. Data   ( A B -- C )
  1184. String ( -- )
  1185.  
  1186. C is TRUE if A equals B, FALSE
  1187. otherwise.
  1188.  
  1189. =$
  1190. Data   ( -- C )
  1191. String ( A$ B$ -- )
  1192.  
  1193. C is TRUE if A$ equals B$, FALSE
  1194. otherwise.
  1195.  
  1196. >
  1197. Data   ( A B  -- C )
  1198. String ( -- )
  1199.  
  1200. C is TRUE if A is greater than B,
  1201. FALSE otherwise.
  1202.  
  1203.