Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble with REPLACE
Message
From
05/02/2002 18:15:55
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
05/02/2002 17:32:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00615778
Message ID:
00615796
Views:
22
Hi Randy

Many people get bitten by this. I believe its related to how we think the code reads.

Perhaps people think REPLACE inv_hdr.invno WITH ThisForm.Nextinv means

put the value THISFORM.NextInv into the field invno in inv_hdr.

The closest line of code to the above English would be

replace invno with THISFORM.NextInv in inv_hdr.

The only time you'd absolutely have to write the code the way you did is if there were one or more related tables and you wanted to use a single replace command to update fields in different aliases.


>Hi, VFP7 user. I tried to run the following line of code. I placed wait windows before & after to debug. Here is what I get:
>
>WAIT WINDOW thisform.nextinv && returns 'S1123-4' (character string)
>REPLACE inv_hdr.invno WITH ThisForm.Nextinv && assigns invoice #
>WAIT WINDOW inv_hdr.invno && returns ''
>
>I am using buffered data. My values and fields are all character. What am I doing wrong (property value will not transfer to field)?
>
>Thanks, Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform