>I did use alines, and it works fine 95% of the time. Its the 5% of the
>time that is killing me. For some reason about every 20th record it loses
>a field or two. I don't know if it is because each record has so many fields
>in it (1435). Here the code using Alines().
>
>DIMENSION aAr(1435)
>vcStr = FGETS(nHandle, 8192)
>vnRecCnt = ALINES(aAr, CHRTRAN(CHRTRAN(vcStr, ["], ""), ",", CHR(13)))
>
>This will work but then it just messes up after so many records?? Plus ALines()
>makes every element a string, so u have to use VAL() to store it as a numeric.
There are alternatives to alines(). Before knowing alines(), I used a combination of memlines(), mline() and the _mline variable. See samples in help.
Important note: the help says that these functions are for memo fields. In fact, they work for any character expression that might contain several lines.
Also, if what you need is to read data from disk, you can use low-level file functions as an alternative (fopen(), fgets(), fclose()).
alines() is limited to the max. size of an array, i.e., about 32K lines.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)