Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using getpem() inside a prg

Status
Not open for further replies.

Ambientguitar

Programmer
Apr 23, 2006
31
GB
I can't seem to get getpem() to work on a procedure that is inside a program. Does anyone have any ideas?
 
GETPEM means Get Property Event Method, when events properties or methof you have in program?

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
I am building a form with a prg it has 8 text boxes which I'm going to use for passing parameters into a method . There are two buttons one calls the getpem(oform,"systest")in th eclick event but nothing seems to return. I have put a wait window before and after and it seems to run past it ok but no method returned? Also I have put a pemstatus(oform,"systest",3) and it shows as a method. I'm stumped!Thanks for the quick reply Boris!
 
put
Code:
WAIT WINDOW getpem(thisform,[systest])
From HELP:
In Visual FoxPro 6.0 and later, using GETPEM( ) to return method code is supported [bold]only during an interactive Visual FoxPro session[/bold]. You can, however, obtain method code from an object by using its Class property.

What you need to do whit GETPEM()? Maybe there is another way.



Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
I have already tried this only without the [] braces. I am trying to put place holders in a method get the mehodcode do a transform on the place holders so that they are replaced with the parameters from the form.
 
Oh! I'm using VFP 8 Boris sorry for not ststing that sooner. I have tried everything I can think of with this it just does want to work inside the prg?
 
Why not just pass all as parameters to this method?
There is no need to do something like you want. Keep in mind that this will works if you are only during an interactive Visual FoxPro session. That means you build some builder to that form. I don't see any reason to use GETPEM(), JUST put
LPARAMETERS par1, par2, par3 ....
at the begining of your method and then test how many parameters you pass to that method.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
I agree Boris this was an experiment to see if I could change the method on the fly and then create a compiled program with the transformed string. There is a method to the madness believe me!lol!
 
[rofl]
So many things leeds to the maddness :) Don't add additional ones.

BTW, You could store method code in table, do whatever you want to do with it and themn use EXECSCRIPT().

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Thank's Boris , I had thought of that but was trying to avoid it, as I say it was a little experiment that doesn't see to be successful. Although I may resort to you method just to see what the outcome is lol!Thanks a bunch anyway.
 
Thanks Mike,

I will have a look,this was just an experiment to see if I could create a system update file which could create a system update file. I know a bit OTT but worth a try.Thanks agian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top