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:
00599718
Views:
24
I tried it, but it doesn't work. Cancel in a program doesn't seem right, and without cancel it doesn't work. I like Sergey's suggestion in this thread. See my TestAppend program. I'm going to do few minor modifications in it.

>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.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform