Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Activating a form from a button on the toolbar
Message
From
04/07/2001 09:16:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00526366
Message ID:
00526661
Views:
17
>In Fox for Dos it was read level events (I've been at this a long time!)
>What happens is that any form started from the toolbar and not from the menu system is not on the same "level" as the menu system and all sorts of strange errors occur. The forms started from the menu cannot reference the form started from the toolbar because they believe it is not an "Object". That is the error "Form 'pm2p008' is not an object!"
>
>We have traced this down in the past to read level events.
>
>Donna

Donna,
Not rdlevel() but variable scope.
The difference is how menu and toolbar instantiate the forms. Menu creates a public object as running from command window does. Toolbar OTOH doesn't create a public object. Whenever you launch a form from toolbar form is added to _screen forms collection (2 per form - same oject, I don't know why 2 per form).
pm2p008 sounds to be the scx name. Loop _screen.forms collection to get scx name. Or if you want it to behave menu way create public var with scx name prior to 'do form' in toolbar and add name clause. ie :

public frmcustomer
do form customer name frmcustomer

Better create a custom oApp and add an array property to it to track forms.

You can also use _screen.activeform to get the reference.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform