"data" statement in TP 
Author Message
 "data" statement in TP



 >



 > : > : 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=-\

  %               http://www.*-*-*.com/ ~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.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. "data" statement in TP7

2. The keys "-"/"+"/"*"

3. "odd" statement

4. Gwbasic "Play " statement for TP7

5. "AND"-statement in TTable filter?

6. "Missing comma" error with SQL statement

7. TQuery SQL statement "Capability Not Supported"

8. Delphi-"Special" SQL statement needed

9. SQL statements don't accept "/"

10. ""256 Color Mouse""

11. "Odd" TP question

12. "Odd" TP question

 

 
Powered by phpBB® Forum Software