WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help me understand (https://www.wowinterface.com/forums/showthread.php?t=52803)

TransformedBG 10-06-15 04:09 PM

Help me understand
 
Is
Local sumAmount = #sumlist

The same as
Local sumAmount = table.getn (sumList) (I think that's the call I'm using... out working not looking at my code.

Aldo what do the # mean

Fizzlemizz 10-06-15 04:28 PM

It means the number of elements in the table (items in the list).

TransformedBG 10-06-15 04:40 PM

Okay.. any ideas why I get an error when I use the # sign?

Basically I'm working on editing an addon I made for cata to work on vanilla...

Torhal 10-06-15 05:17 PM

Quote:

Originally Posted by TransformedBG (Post 311360)
Okay.. any ideas why I get an error when I use the # sign?

Basically I'm working on editing an addon I made for cata to work on vanilla...

Ouch. You've been a member for five years, and have no idea that talk of private servers is forbidden? :/

TransformedBG 10-06-15 05:44 PM

Quote:

Originally Posted by Torhal (Post 311361)
Ouch. You've been a member for five years, and have no idea that talk of private servers is forbidden? :/

I'm not playing private... I'm just tinkering with code... trying to understand the coding differences.

Fizzlemizz 10-06-15 06:27 PM

Regardless of the legitmacy, without seeing the actual code and/or erros anything put forward would be a wag.

Clamsoda 10-06-15 06:35 PM

Perhaps the # table length operator wasn't present in whatever subset of Lua that was used in Vanilla WoW. I know that there was a transition from getn() to # through the expansions of WoW.

Unfortunately, if you are reporting errors spit out from Vanilla's Lua parser, then you aren't going to get any help here.

SDPhantom 10-06-15 08:25 PM

Vanilla WoW ran Lua 5.0, which the length operator didn't exist in that version. Starting with BC, WoW had upgraded to using Lua 5.1.

TransformedBG 10-06-15 08:49 PM

Quote:

Originally Posted by SDPhantom (Post 311365)
Vanilla WoW ran Lua 5.0, which the length operator didn't exist in that version. Starting with BC, WoW had upgraded to using Lua 5.1.

now it all makes sence.. thats the answer i was looking for lol.. thank you.


All times are GMT -6. The time now is 12:14 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI