[fpc-pascal]parsing text and working with strings

the reverend the.reverend at coastgames.com
Thu Oct 18 20:16:25 CEST 2001


what is the most efficient way to parse a space-delimited fixed width text
file to an integer array?

also, i am rather new to freepascal and i have just discovered the plethora
of string functions spread about in different libraries (strings, sysutils,
and the system unit).  i would prefer to work with Strings, not PChar,
because i am rather weak on working with pointers, but i have written some
functions that basically make PChar functions into String functions for
simplicity.  (and what is an AnsiString?)

some functions i am looking for are:
  1) strip duplicate delimiters, (can be used to remove extra spaces [#32]
also)
  2) parse delimited string to array
  3) translate a table of characters in string to another table
  4) ...

is there a library that perhaps has a lot of this done already outside the
standard freepascal libraries?  for simplicity's sake, i'd prefer to just
work with a single type, hopefully Strings, but i can learn to use PChar if
it is in my favor.





More information about the fpc-pascal mailing list