"data" statement in TP

-=[ In:vo...@paratiritis.the. was heard to say... ]=-

 In> Nexus User wrote:
 >
 > Votis (vo...@paratiritis.the.forthnet.gr) wrote:
 > : Nexus User wrote:
 > : > Jeremy Gershwin (mul...@gate.net) wrote:
 > : > : Is there a data statement like in BASIC or FORTRAN?  I need to store
 > : > : values in a string array and would like not to have to set each array
 > : > : subscript equal on separate lines.
 > : >
 > : > Write your data to a binary file - raw numbers only.
 > :
 > : Use a typed constant, such as:
 > :
 > : const
 > :   my_data : array[1..3] of string[10] = ('one', 'two', 'three');
 >
 > Yes, but what if you have HUNDREDS of bytes?  Are you going to do
 > constants for all of them?
 > If you want strings and such forth, use the ascii values and an end of
 > string marker of your choice, and just interpret the data appropriately -
 > it's not all that hard

 In> BTW, the array which will finally hold the data can not exceed 64K
 In> either. Of course we can use an array of pointers and allocate strings
 In> on a per-needed basis, but this makes the whole process even more
 In> complicated -- I hope you see my point.

 In> Votis Kokavessis

Using pointers to strings is not very much more complicated than using
ordinary strings at all. You just need to set up your own routines for
adding and removing them, which would be no harder to use than ReadLn() or
WriteLn() or whatever. I use arrays of pointers to strings all the time,
and find them to be well worth the tiny bit of extra trouble.

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\
  $          Kim Forwood  <kim.forw...@access.cn.camriv.bc.ca>           %
  %              http://goodship.cn.camriv.bc.ca/~kforwood/              $
  $         For what purpose is life, if one cannot live freely?         %
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/
            WARNING: Spammed email sent to me will be redirected
               to the sender's ISP. Flames merely laughed at.