>UPDATE-SQL doesn't seem to work with properties. For example, the following creates an error that TEXTLASTNAME isn't found.
>
>
LOCAL oPage as object, iIndex as Integer
>
>oPage = ThisForm.PFrame1.Page1
>iIndex = 45
>
>UPDATE MyTable ;
> SET MyField = oPage.TextLastName.Value ;
> WHERE MyIndex = iIndex
>
>However the REPLACE command does work as follows.
>
LOCAL oPage as object, iIndex as Integer
>
>oPage = ThisForm.PFrame1.Page1
>iIndex = 45
>
>SELECT MyTable
>REPLACE MyField WITH oPage.TextLastName.Value ;
> FOR MyIndex = iIndex
>
>I have noticed this in all of VFP 6/7/8. I know I can make local variables from the object properties and it works, but that seems a kludge. Is there some other way around this to get UPDATE-SQL to work?
>
>Thanks in advance,
>David
Actually, there are several places where you need variables, not properties.
You might try alternatives, like enclosing ThisForm....Property in parentheses (I don't have VFP here right now, to test this out), but in general, be prepared to use variables in some special cases.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)