AnsweredAssumed Answered

A note on token format

Question asked by VRFuser on Feb 3, 1998
Dear folks,
     Recently I stumbled upon a nice feature of the token format that I
     feel people may like.  It is somewhat 'undocumented', and perhaps
     could be made more clear in the Vee documentation.
     We all note that the choices for reading from a token format seem
     inadequate.  We ask: What if I want to use tab seperation?  My data
     may contain whitespace (Like in text-sentances) that I DON'T want
     seperated apart. The selection for token seperator only has <space>
     and the exclude and include character choices.  BUT, there is a lot
     more power there than meets the eye.  What the Vee help file does not
     do a good job explaining is that IF the fields of your file are
     quotation encapsulated, then Vee does not seperate token fields by the
     <space> while within the quoted field.
     We think there is a problem:  here's an example of what we may wish to
     read from a file.  It contains: <int> <int> <comment>
     Your file has one line: 8 7 That is all
     Would Vee read in the tokens as: 8,7,That,Is,All
     YES, it would.
     But if your file has the following:
     "8" "7" "That is all"
     Then Vee , very smartly, reads in:  8,7, That Is All
     (the commas are my way of denoting each element of an array.  Vee
     returns an array from the token format transactions.
     What do I feel was undocumented: I feel that the Vee documentation
     does not clearly enough point out that the quotations around a set of
     data allow the data to contain spaces.  This makes the token format
     VERY useful since I don't have to worry about white-space messing up
     the token-parsing.
     The complement to this is to write To-String in a "quoted string
     format".  Pass in an array of strings and Vee automatically writes one
     line of text with quotations around each index of the array, with a
     space between each of these 'fields'.
     In closing:
     Using this formatting, I found my file I/O to be a lot more slick, and
     faster than doing a lot of string parsing.
     Also, Microsoft's frontpage has the space seperated spreadsheet format
     for storing data from a form (with quotation encapsulated fields) for
     those of you who have your Vee programs linked to some input file from
     a web-page.)
     Thanks for reading my rambling,
     Andrew Hamilton
     (Not affiliated with the Vee team)