Thread: Debugging... print function?
-
June 8th, 2007, 10:11 #1
- Join Date
- May 2007
- Posts
- 46
Debugging... print function?
I'm taking my first baby steps towards learning lua and how it applies to fantasygrounds. It's slow going, but I've run into a little snag concerning the print function and its proper use. I guess a lot of it has to do with the syntax of how to call variables in a table, but let me try to explain.
Basically, when I try to print a variable to the console for debugging purposes, I seem to return a (null) value no matter what I do when the variable is contained in a table of some sort. Here's the exact code block in questions.
Code:-- Name for k, v in ipairs(getWindows()) do if source.getChild("name") then newentry.name.setValue(source.getChild("name").getValue()); print(k) print(newentry.name) end end
When I run FG and add an NPC to the combat tracker, this is the output in the console window, assuming I already have four other entries.
Code:Script Notice: 1 Script Notice: (null) Script Notice: 2 Script Notice: (null) Script Notice: 3 Script Notice: (null) Script Notice: 4 Script Notice: (null) Script Notice: 5 Script Notice: (null)
Originally Posted by Error message
-
June 8th, 2007, 13:59 #2Originally Posted by SniperDM
Have you tried
Code:print(newentry.name.getValue());
-
June 8th, 2007, 14:34 #3
- Join Date
- Feb 2005
- Posts
- 160
Originally Posted by joshuha
-
June 8th, 2007, 20:16 #4
- Join Date
- May 2007
- Posts
- 46
print(newentry.name.getValue());
Still, I keep getting that memory error every time I try to open the console and then close the program, which is why I originally posted to house of healing instead of the workshop, even though my output is fine now. Is anyone else experiencing anything similar?
-
June 8th, 2007, 21:28 #5Originally Posted by sunbeam60
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks