Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETPEM() in VFP 6.0 is NOT SUPORTED IN RUN TIME
Message
From
07/10/1998 23:40:31
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00143709
Message ID:
00144889
Views:
25
>I actually found a better work around than using getmethod.prg. Simply pass the class name. So instead of GETPEM(object,method), just use GETPEM(object.class,method) and it works at runtime in VFP 6.0. Appears that the design time comment in the docs is an error also. I plan to remove getmethod.prg from my web site since it's really not needed.

Turns out that GETPEM() is not broken at all in VFP 6.0. It's basically FIXED from VFP 3.0/5.0. Here is the detailed explaination. In VFP 3.0 and 5.0, GETPEM() only returned method code for the object instance that was passed

In VFP 6.0, GETPEM() now considers an object reference passed (1st parameter) as an instance. When you do a NEWOBJECT() on a class, you get an instance of that class, while the code for the object is in the class, not the instance. So GETPEM() returns an empty string for an object instance, by design. If you want the code from the class, simply use GETPEM(object.class,method). If you are referencing an object at design time (form/class designer) using ASELOBJ() or SYS(1270), then you can use GETPEM(object,method) because the object reference in the designer is at the class (class level), not instance level, so you do get the code without passing the class name.

To clarify the docs, GETPEM() works at design time and runtime (of the development version of VFP6, VFP6.EXE), but it doesn't return method code for the distribution mode of VFP6 (VFP6R.DLL). If you execute GETPEM(object|class,method) in the VFP Runtime (DLL, ActiveDoc, EXE, etc.), then you will simply get the class name back as the return value, not the source code of the method.
Previous
Reply
Map
View

Click here to load this message in the networking platform