Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace command oddity - VFP3.0b for Windows
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00083511
Message ID:
00083514
Views:
22
>The following works: replace junk.name with "test " + junk.name
>
>but this does not: replace junk.name with junk.name + " test"
>
>Why? Is this a bug, or is there something strange about the way VFP evaluates this expression.

Evan, there is no bug. It will work that way even in VFP5 :)
What happens with junk.name+"test" - the total lenght of the expression result exceeds the field lenght, and it gets truncated. Make expression as:

replace junk.name with alltrim(junk.name) + " test"
and you will see it (of course if the junk.name doesn't occupy whole field lenght.)

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform