WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   NIL value when referencing text box (https://www.wowinterface.com/forums/showthread.php?t=4806)

MilkmanWes 05-12-06 06:28 AM

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)"

Iriel 05-12-06 10:59 AM

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)

MilkmanWes 05-14-06 04:46 AM

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.


All times are GMT -6. The time now is 11:30 AM.

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