Page 1 of 1 1
Topic Options
#212620 - 2017-08-14 05:41 AM isFunction()
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
[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

Top
#212622 - 2017-08-14 06:15 AM Re: isFunction() [Re: AndreLuiz]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=203038#Post203038
Top
#212623 - 2017-08-14 06:46 AM Re: isFunction() [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
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

Top
#212680 - 2017-09-17 05:08 PM Re: isFunction() [Re: Allen]
lupacexi Offline
Just in Town

Registered: 2017-08-31
Posts: 2
Loc: VN
Thanks!
Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 370 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.056 seconds in which 0.025 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org