LUA ~ how can i verify if functions , var or table exists ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

LUA ~ how can i verify if functions , var or table exists ?

Post by skinkairewalker »

hi everyone !

Lua Question ~ How can i verify if funcions , variables or tables exists in lua code or lua file ?

someone know how can i do it ? :D

:D
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: LUA ~ how can i verify if functions , var or table exist

Post by IdeasVacuum »

In the IDE, use Find String.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

Re: LUA ~ how can i verify if functions , var or table exist

Post by skinkairewalker »

thanks by you answer xD !
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

Re: LUA ~ how can i verify if functions , var or table exist

Post by skinkairewalker »

i have another question !

every time if i call command > " lua_getglobal " , and " lua_call() " , i can run especific function in lua code ... but ... if have a syntax error , lua stop working ... ( lua dont verify if have errors ) ...

what can i do to fix it ?
User avatar
Dadido3
User
User
Posts: 54
Joined: Sat Jan 12, 2008 11:50 pm
Location: Hessen, Germany
Contact:

Re: LUA ~ how can i verify if functions , var or table exist

Post by Dadido3 »

Hi,

just use lua_pcall instead of lua_call.
I even gave you a full example in an earlier post: http://www.purebasic.fr/english/viewtop ... 76#p499376
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

Re: LUA ~ how can i verify if functions , var or table exist

Post by skinkairewalker »

thanks by you answer :D

now working fine :D
Post Reply