Thread Tools Display Modes
10-06-20, 07:24 PM   #1
TransformedBG
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 23
lists with variables?

is there a way to put a variable into a list? my brain aint working today...


ie:

Code:
some_list = {}
some_list["whatevre"] = {
"something something something " (some variable) " sometihng something.",
....
}
I mean other than a global variable thats made before it.. but if i wanted that variable to change more frequently.
  Reply With Quote
10-06-20, 08:29 PM   #2
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
I cannot tell if you are asking how to concatenate the text, or to pass a value 'by reference' into a table?


The concatenation operator is ..

"something something something" .. myVar .. "something something."




When you add the following to a table, it actually passes a reference or pointer to it:
- another table
- a function

But when you add the following to a table, it evaluates and passes the current value only:
- a number
- a string
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » lists with variables?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off