Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing a form externally
Message
From
28/04/2003 14:08:17
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00782361
Message ID:
00782367
Views:
10
>Hi,
>
>I am getting hung up on referencing an open, modeless form from another routine.
>the SCX name is DUTYINFO.SCX and the form Name is frmDUTYINFO.
>I get the error "Object does not exist" when I try to reference it as DUTYINFO or frmDUTYINFO. wexist('frmDUTYINFO') returns .T.
>
>What am I doing wrong?
>
>TIA

Ashley --

You have the name of the form, not the object reference to it.

To get the object reference, use the _SCREEN.Forms array of active form objects. Cycle thru with:
loForm = .NULL.
FOR X = 1 TO ALEN (_SCREEN.Forms, 1)
   IF UPPER (_SCREEN.Forms[X].Name) = "FRMDUTYINFO"
      loForm = _SCREEN.Forms[X]
      EXIT
   ENDIF
ENDFOR

IF NOT ISNULL (loForm)
   &&   Do processing using loForm object reference.
   ...
ENDIF
Jay
Previous
Reply
Map
View

Click here to load this message in the networking platform