2006/6/6, David Nicolás Abdala <[EMAIL PROTECTED]>:
> Hi all,
>
> here is the CSV decoding function. I have a problem with the array of
> string as the compiler is saying the type is not good when trying the
> SetLength(a). I must create a type for this.
>
> Now I submit this procedure (because a function cant' return an array
> of string, but could probably return the type?) and I want inputs:
> - a better solution for 'array of string'
> - if no solution, is a function better?
>
> Then after I received the input I'll send a patch for sysutils (when
> the forum is up again).
>
> Thank you very much (for making this code and fpc/lazarus better). :)
Why don't you use a TStrings instead of an array of string?
I don't know about CSV use, but using a TStrings will release you from the
memory allocation for the strings..
That way you can also make it a function that returns a TStrings (I don't
think this is a good idea, but you have the choice)
TStrings is not allowed in such a low-level procedure. This is not my
intention to use components. It need to be fast to process a lot of
records as fast as possible at low-level. As it is now, the procedure
could be used in many upper level classes or programs without huge
uses requirements. So it is also very good for small CGI applications
and other thin apps. These are the main reasons of my motivation to do
it this way.
Regards.
--
Alexandre Leclerc
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives