ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Jan 29, 2020 3:15 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Jul 09, 2017 2:08 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
I need a global variable accessible by all functions. Just the one!

Where in my add on should I place

my variable = 15

?

_________________
MADNESS rocks


Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 10:18 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10477
Location: Angolwen
you cna define it form anywhere, i'd say the load hook though, and you make one explicitly this way: _G.foo = bar

_________________
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)


Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 3:51 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
darkgod wrote:
you cna define it form anywhere, i'd say the load hook though, and you make one explicitly this way: _G.foo = bar


Thanks.

After a bit of experimenting, I realised I had to call it every time as _G.foo (duh!), not just foo.

_________________
MADNESS rocks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: tabs and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group