
problem using EVAL() with form property referencing
Greg,
Are you sure this object is a form? It could be a formset. The easiest way
to tell would be to put a command in your code that does this:
WAIT WINDOW EVAL(pcFormName+'.BaseClass')
FormSets don't have a caption property, though the form(s) within them do.
Since all the properties that are working are custom properties, it's hard
to tell whether you're actually dealing with a form.
--
Josh Weiss
Boston Microcomputer Consulting
http://emporium.turnpike.net/~bmc
Remove Xs from e-mail address when replying
Quote:
>The following code is from a custom class that manages the forms in an
>application.
>* DO form
>IF lLoginOK
> PUBLIC (pcFormName)
> DO FORM (pcFormName)
> STORE THIS.cUserId TO (pcFormName + ".cUserId")
> STORE THIS.nUserAccess TO (pcFormName + ".nUserAccess")
> STORE THIS.cUserName TO (pcFormName + ".cUserName")
> STORE THIS.nFormRecNo TO (pcFormName + ".nFormRecNo")
> IF !EMPTY(THIS.cName)
> STORE EVAL(pcFormName + ".caption") + " [" + PROPER(THIS.cName) + "]" ;
> TO (pcFormName + ".caption")
> ENDIF
>ENDIF
>The EVAL() function in the IF/ENDIF segment returns the error "Variable
>'CAPTION' is not found." (Error 12). All the references to the forms
>properties work except this one. (It's purpose is to display the user's
>name in the title bar of the form.) I am baffled because the last time I
>ran this code I remember it working just fine and I haven't made any
>changes to it. I am using VFP 5.0a