Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This one has me baffled
Message
From
30/03/1998 09:54:10
 
 
To
30/03/1998 00:30:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00088012
Message ID:
00088090
Views:
32
To All:

Thanks all for your replies but I'm still having problems. The problem is that NO reference to the object exists in memory - the window is not listed under ANY name. (I make a habit of naming forms the same as their DOS SCX filename to avoid problems like this.) The form/object is clearly there in fact wexist() finds it otherwise line 2 of the code would not be executed. I did try your suggestion of using names in the do form statement but it didn't make any difference.

Still baffled ...

Gerry.

>>A menu option calls the procedure with a parameter (the form to launch mFormName):
>>
>>PROCEDURE LAUNCHFORM
>>1 if wexist(mFormName)
>>2 mCommand=mFormName+".Show"
>>3 &mCommand
>>4 else
>>5 do form &mFormName
>>6 endif
>>RETURN
>>
>>which, to my simple mind should work.
>>
>>Lets say the form has not been launched and so does not exist in this instance of the app. Calling the code above correctly launches the else portion and launches the form.
>>
>>If I immediately call the procedure again, via a second call to the menu option, the code pukes at line 2 with the error "Object OUTGOING is not found". (OUTGOING being the value of mFormName). It has correctly identified that the window does exist - and it does because I can see it on the screen - but it ceases to exist in the sense that I can call its "Show" method.
>>
>>A LIST OBJECTS at this point confirms that the object does not exist ... or does it ? Or is a window not an object ?
>>
>>Gerry.
>There appears to be a conflict ( or else I didn't see where you created the object name ) between the naming of your form ( window in the wexist() sense ) and the refering object. I prefer to 'fire' up forms with a command like:
>
>do form xx name goxx linked
>
>This allows me to externally reference the form xx's methods in the procedure code with object references:
>
>goxx.show()
>
>I also code the teminal () to clearly show methods from attributes -- helps me when I am in a hurry later. VFP's oop does not start with 'Hungarian' naming conventions, so you can tell at a glance that a name is an attribute or a method, so I add the '()'. Hope I understood your problem and that this helps.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform