Thread Tools Display Modes
05-12-06, 06:28 AM   #1
MilkmanWes
A Murloc Raider
Join Date: May 2006
Posts: 4
NIL value when referencing text box

Constructed a working tutorial project then tried to build something of my own and am having trouble. After 90 minutes hacking at it and reading, it is now time to go to work so I humbly ask for assistance.


Project: Simple in game calculator form to take entered values and give a DKP estimate based on a modifuied Zero Sum formula.

LUA Code (with line numbers inserted for easy referral):
Code:
5	local AdjUnits, Units, UnitsBox, Seed, SeedBox;
6
7	UnitsBox = getglobal("DKP2CalcForm".."Units".."Edit");
8	Units = UnitsBox:GetNumber();
Code explanation:
Where DKP2CalcFormUnits is a single line editbox. This edit box has a positive integer value when function is called. Units should be set to the numeric value of UnitsBox

Error Message:
Recieving error on line 8 "attempt to index local 'UnitsBox' (a nil value)"
  Reply With Quote
05-12-06, 10:59 AM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
Do you have a frame called:

DKP2CalcFormUnitsEdit

Defined in your XML? (I'm hoping that the use of getglobal in this example is because you've simplied the code for diagnosis and removed some otherwise dynamic values, since it's really not doing anything on its own)
  Reply With Quote
05-14-06, 04:46 AM   #3
MilkmanWes
A Murloc Raider
Join Date: May 2006
Posts: 4
I corrected the problem, removing the use of getglobal corrected it and I am not sure why. A tutorial I went by used it in every case and I was using it to mimic what I saw in the sample code.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » NIL value when referencing text box


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