problem using EVAL() with form property referencing 
Author Message
 problem using EVAL() with form property referencing

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



Wed, 04 Oct 2000 03:00:00 GMT  
 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



Fri, 06 Oct 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can't reference on forms properties from another form

2. Form array properties: passing by reference

3. Cant Reference other Forms Properties

4. reference form property in a function

5. Referencing properties on non-active form

6. referencing properties in a non-active form

7. Referencing form properties

8. Referencing properties from another form

9. Release form problem (after filling form property)

10. Using a form to set class properties

11. LOCATE using a form property

12. Forms Refrence by using property ?

 

 
Powered by phpBB® Forum Software