Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange behavior using REPLACE command
Message
From
06/06/2003 08:43:36
 
 
To
06/06/2003 08:38:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00797167
Message ID:
00797169
Views:
19
Hi Jim

If your current record number in the active work area is 0 or at the so called phantom record (reccount()+1), you will have this result. Simply switch to the relevant work area first with SELECT tablename, and your problems are gone.

>I'm a little sheepish posting this, but I am experiencing wierd behavior which is kicking my butt, so I need some input.
>
>I'm using a procedure call from a screen that is importing data to a non-buffered table. I'm using a simple method of APPEND BLANK to my target table and then using REPLACE field WITH value IN TARGETTABLE. My APPEND BLANK is working and my table is populated with primary keys being generated in my DBC code. However, NONE of my replace statements are populating the table. The target table is completely blank except for the primary key values. Here are some conditions:
>
>-The table is not buffered, confirmed with both CURSORGETPROP('buffering') and attempting a TABLEUPDATE, which fails since table is not buffered.
>-The target table is selected during the REPLACE commands(which shouldn't matter anyways, I'm using REPLACE IN tablename
>-The correct datasession is active
>-I reindexed the table, no effect
>-ERROR handling is turned off, and I'm not getting any error messages on any REPLACE commands (confirmed running through debugger).
>-This is where it gets wierd, if I run the code in the debugger and in the middle of the REPLACE statements I BROWSE the table, then the fields begin to get populated with values as I continue to STEP through the REPLACE commands. If I close the browse and continue on, then the table is not getting updated past that point when I closed the browse. However, any values that were entered while the browse was active still remained saved in the table.
>-If I simply open up the table all by itself in a VFP session and issue append blanks and REPLACE in the command window, the table is updating correctly
>-Not sure if it's relative, but I've gotten an occasional internal consistancy error over the last week in VFP.
>-I'm using VFP6.0 and XP
>
>Perhaps it's time to reinstall VFP?
>
>Thanks in advance.
>
>Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform