Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APPEND BLANK in 'MyDBF' not consistent?
Message
From
01/10/2000 22:50:04
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00422792
Message ID:
00423300
Views:
8
From the VFP docs on "Replace":

"Note If the IN clause is omitted, no replacement occurs if the record pointer is at the end of the file in the current work area and you specify a field in another work area."


>more like ..
>select FileToAppend && Its actually a blank cursor
>zap
>Select FileToRead
>gotop
>scan && !eof()
>Match=FileToRead.Field1
>Total=0
>scan while FileToRead.Field1=Match
>Total=Total+FileToRead.Field2
>appen blank in 'FileToAppend' && Works okay here
>repl FileToAppend.Field1 with FileToRead.Field1,FileToAppend.Field2 with FileToRead.Field2
>endscan &&while FileToRead.Field1=Match
>appen blank in 'FileToAppend' && Works okay here except for eof()
>repl FileToAppend.Field1 with "Total",FileToAppend.Field2 with Total && Adds a blank record but does not replace **UNLESS**
>endscan &&!eof()
>
>**UNLESS**
>I use the following syntax:
>Select FileToAppend
>append blank
>replace .....
>select FileToRead
>endscan &&!eof() , etc.
>
>
>
>>I would guess that you're doing something like
>>
>>select file 1
>>scan
>> replace file2.field1 with file1.field1
>>endscan
>>
>>Where you're never actually selecting the 2nd file.
>>
>>If the currently selected file is at EOF, you can't replace into another file. If you select your second file and replace into it from the 1st file you won't see the problem.
>>
>>PF
>>
>>
>>>The syntax:append blank in 'myfile' doesn't seem to fire in all cases. A blank record was added, but the subsequent REPLACE did not put anything in the fields. It seems to happen at the last record being appended. The replaces worked in all but the last record. My work around required a SELECT MyFile and then an APPEND BLANK.

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform