setstate problem with list, different problem with multi-line text fields

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

setstate problem with list, different problem with multi-line text fields

Mike-206
-- plua2test.lua
local t = {"list1","list2"}
msgList = gui.list(6,25,t)
if(msgList == nil) then
    print("nil")
else
    gui.setstate(msgList,1)
    gui.setstate(msgList,2)
end

while 1 do
    ev,id,idx = gui.event()
    if ev == appStop then
        break
    end
end

I run this once, I get a list with two items on it along with the word
"nil" printed on it.  I quit and run it a second time, I get
memo:/plua2test.lua:8:bad argument #1 to `setstate`(number expected,
got no value).  Often, my palm resets.

I'm running on a Treo 600.  Just now I ran it 5 times, I got the error
each time.  I ran it one more time, I got a list with "nil" printed
next to it.  Finally I ran it again and my phone reset.

I tried taking out the "local" on the t.  I tried declaring the list
with a size of 2 instead of 6.  Neither thing worked.

Also, when I attempt to create a text field with more than one line,
it fills up the rest of my screen with many more lines than I declared.

Any help on these things would be appreciated.  I would really like to
program something useful using this language.









 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/plua/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/