Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetPem() in disarray
Message
From
30/12/2016 14:34:07
 
 
To
30/12/2016 13:22:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Miscellaneous
Thread ID:
01646177
Message ID:
01646223
Views:
55
>>>>>>
>>>>>>?eval("oo."+"arr[2,2]")
>>>>>>
>>>>>
>>>>>Eval() is only slightly better than macro - that's what I eventually did, that's the quick and dirty.
>>>>
>>>>not true. Check it.
>>>
>>>I know it's lots faster and doesn't hide compilation errors (like a macro does - one & somewhere on a horribly wrong line and it goes uncompiled until runtime), but it's still something that's interpreted at runtime and I'd better check for type of the expression I'm eval()uating so it doesn't error out. I guess getpem() and pemstatus() are doing the same, more or less.
>>>
>>>In this case I had to do an ascan() on one of the dozen arrays stored as properties of This, and then pick the element from that row. Works fine enough with a macro for the array name, though now I'm thinking it may be better served with storing all of these values into a cursor (actually two cursors, one array has three columns while others have two).
>>
>>
>>? type("oo.arr",1)
>>? type("oo.arr[2,2]")
>>? type("oo.arr[7,2]")
>>
>
>It's exactly that 2nd parameter that I wish we had in getpem(), to return an array when there is one. But then it would have to be either a copy or some kind of weird reference to the array property. Anyway, issue is moot - no fixes anymore, but then no new bugs either :).

Description of the function in the help says: Returns the current value for a property or program code for an event or method at design time.

In the VFP 6 help at the end it states:
> Remarks
> GETPEM( ) is supported only during an interactive Visual FoxPro session.

In the VFP 9 help:
> In Visual FoxPro 6.0 and later, using GETPEM( ) to return method code is supported only during an interactive Visual FoxPro session. You can, however, obtain method code from an object by using its Class property, as in the following code:
>
LOCAL oObject, lcCode
oObject = NEWOBJECT("_form", HOME()+"ffc\_base.vcx")
lcCode = GETPEM(oObject.class, "Release")
From this I'd assume that the GETPEM() was probably only meant to be used in some sort of builder or utility in the development environment rather than in application code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform