AndreLuiz
(Getting the hang of it)
2017-08-14 05:41 AM
isFunction()

[ptbr]
Acho que deveria haver uma forma de saber se foi ou não incluído uma função.

[eng(TRANSLATE)]
I think there should be a way to know if a function has been included or not.

 Code:
isFunction('bsort') ;;return 1 or 0


AllenAdministrator
(KiX Supporter)
2017-08-14 06:15 AM
Re: isFunction()

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=203038#Post203038

AllenAdministrator
(KiX Supporter)
2017-08-14 06:46 AM
Re: isFunction()

Wow... this wasn't easy to convert to a function. Probably why Richard never did to begin with. Anyway if you want to try this go ahead. I'm thinking the first issue you will run into is functions with required parameters. Also, make sure you put the function name in quotes.

 Code:
? Isfunction("FOO")
? Isfunction("Bar")

Function Foo()
	exit 0
EndFunction

Function IsFunction($FN)
  Dim $RC
  $RC=execute("$" + "IsFunction=iif(CSTR(" + $FN + ")='" +  $FN +"',0,1)")
EndFunction


lupacexi
(Just in Town)
2017-09-17 05:08 PM
Re: isFunction()

Thanks!