home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d471 / molewt / struct.4th < prev   
Text File  |  1991-04-17  |  742b  |  32 lines

  1. \ Struct.4th
  2. \ These are some miscellaneous words that I have found useful
  3. \ in defining and linking structures
  4. \ John Kennan
  5. \ 3-18-88
  6.  
  7. Find Struct4th NOT
  8.    IFTRUE
  9.     : Struct4th ;
  10.     ." Compiling Struct.4th" CR
  11.    OTHERWISE
  12.     Prior.Stream
  13.    IFEND
  14.  
  15. : GetNext ( addr--naddr )  \ in a series of 0 ended string - get next string
  16.     DUP 0$LEN 1+ + =CELLS ;
  17.  
  18. : Intuitext>Text ( n\textarray\IntuitextArray-- ) \ place ptrs to text in 
  19.     +itIText                  \ intuitext at run time
  20.     ROT 0 DO
  21.         2DUP !
  22.         Intuitext + SWAP GetNext SWAP
  23.     LOOP
  24.     2DROP ;
  25.  
  26. : CopyStructure ( saddr\daddr\size\n-- )  \ make n copies of structure at saddr
  27.                       \ starting at daddr ( n > 1 )
  28.     1- 0 DO
  29.       DUP 2OVER ROT CMOVE
  30.       DUP ROT + SWAP       \ increment destination
  31.     LOOP CMOVE ;
  32.