Re: Does a method exist? by Stefan
Stefan
Wed Mar 23 02:01:52 CST 2005
"David Younger" <davidyounger1@hotmail.com> schrieb im Newsbeitrag
news:ut3IuW3LFHA.3844@TK2MSFTNGP14.phx.gbl...
> How can I tell whether a method exists in an object?
>
> I have a process that is passed a form as a variable and I want to run a
> particular method if it exists on the form.
>
> Running TYPE("MyForm.MyMethod") return "U" even if the method exists.
>
> I could probably just instantiate the method and handle the erorr if it
> doesnt exist but there must be a more elegant way?
You can use PemStatus()
oForm = CREATEOBJECT('Form')
? PEMSTATUS(oForm, 'Show', 5)
? PEMSTATUS(oForm, 'Unknown', 5)
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------