Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Expansion
Message
From
09/01/2002 08:40:25
 
 
To
09/01/2002 07:59:47
John Marrone
Bloodstock Research Inc.
Lexington, Kentucky, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00602412
Message ID:
00602451
Views:
47
John,
Just a guess, but could it be that the records that cause you troubles contain embedded commas?
Example:
vcStr=["text",1,2,3,"text,with,commas"]
?ALINES(aAr, CHRTRAN(CHRTRAN(vcStr, ["], ""), ",", CHR(13))) && returns 7
vcStr=["text",1,2,3,"text without commas"]
?ALINES(aAr, CHRTRAN(CHRTRAN(vcStr, ["], ""), ",", CHR(13))) && returns 5
This looks like you are trying to import some data. In fact your problem reminded me of another thread. I found the message and interesting enough, it was a thread that you've started ;-)

Check out the Message #587939 again and see if the code there wouldn't help.

However, if you have embedded commas, then you'd have to make some changes since this code basically uses ALINES(). Let me know if this is the case. I have a function aWords() that allows you to keep literal strings together.

HTH
>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.
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform