Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append for few records
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00598952
Message ID:
00599712
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
OK this is a little odd but seems to do what you want.

append from (m.tcFileName) delimited with tab ;
for inlist(state,'MA','CT','RI','NH') and OkDone(100)

function OkDone
LPARAMETERS lnStopNumber
IF RECCOUNT() >= lnStopNumber
cancel
endif
return .t.

Ok.
Bye.
Mark.


>I think, you're right. Do you have ideas, how can I limit append for only few records? Do I need to use low-level functions instead?
>
>>>>>>>Hi everybody,
>>>>>>>
>>>>>>>I can not get to work this simple command:
>>>>>>>
>>>>>>>append from (m.tcFileName) delimited with tab ;
>>>>>>>	       for inlist(state,'MA','CT','RI','NH') and reccount()<100
>>>>>>>
>>>>>>>I want to append only few records, then check the file, then if it's correct, append all.
>>>>>>>
>>>>>>>Could you please advise, why it doesn't work, as I think, it should?
>>>>>>>
>>>>>>>Thanks in advance.
>>>>>>
>>>>>>
>>>>>>Maybe you already have more than 100 recs.
>>>>>>Cetin
>>>>>
>>>>>No, I zapped the table before appending.
>>>>
>>>>And there is at least one row with one of those states in file ?
>>>>Result is 0 recs ?
>>>>No trigger etc that would deny recs ?
>>>>Strange.
>>>>Cetin
>>>
>>>Really strange. I'll try again. The file indeed contains CT records (945K of them)
>>>Still doesn't work.
>>>
>>>More info: each time it seems like VFP hangs and I have to kill VFP.
>>>
>>>Here is my test command:
>>>append from (m.tcFileName) delimited with tab ;
>>> for inlist(state,'MA','CT','RI','NH') and not m.plHalt and reccount()<5
>>>I'm trying it from command window
>>>I set plHalt = .f.
>>>on escape plHalt = .t.
>>>
>>>I guess, it would not work for some reason. The text file contains more than 1MM records, could it be a problem?
>>
>>I think so. With FOR clause foxpro has to process whole text file regardless how many records meet criteria.
Mark S. Swiencki
EPS Software www.eps-software.com
mark@eps-software.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform