Thread Tools Display Modes
10-06-15, 04:09 PM   #1
TransformedBG
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 23
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
  Reply With Quote
10-06-15, 04:28 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
It means the number of elements in the table (items in the list).
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-06-15, 04:40 PM   #3
TransformedBG
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 23
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...
  Reply With Quote
10-06-15, 05:17 PM   #4
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by TransformedBG View Post
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? :/
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
10-06-15, 05:44 PM   #5
TransformedBG
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 23
Originally Posted by Torhal View Post
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.

Last edited by TransformedBG : 10-06-15 at 05:48 PM.
  Reply With Quote
10-06-15, 06:27 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Regardless of the legitmacy, without seeing the actual code and/or erros anything put forward would be a wag.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-06-15, 06:35 PM   #7
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
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.
  Reply With Quote
10-06-15, 08:25 PM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-06-15, 08:49 PM   #9
TransformedBG
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 23
Originally Posted by SDPhantom View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help me understand

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