This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Henness's profile picture

[lua][Question] Using a Table as an Argument.

Started by Henness, 30 January 2013 - 12:48 AM
Henness #1
Posted 30 January 2013 - 01:48 AM
I took the code from the read() and modified it to edit multiple lines and allow you to use the up and down arrow keys to move to previous or next lines. But I'm having problems using a table as a argument in my function. Is there a special way of doing this? Thanks for the help.

http://pastebin.com/6haHj8HQ
theoriginalbit #2
Posted 30 January 2013 - 02:05 AM
at a first glance try using something other than 'table' … it could be getting confused with the type table…
Henness #3
Posted 30 January 2013 - 02:27 AM
Nope still doesn't work.
theoriginalbit #4
Posted 30 January 2013 - 02:29 AM
Typo:
_tCurrentInput
vs.
_CurrentInput
Henness #5
Posted 30 January 2013 - 02:33 AM
sorry changed that while you were looking at it check it again please.
Henness #6
Posted 30 January 2013 - 02:42 AM
It doesn't make sense because the original read() uses a table as an augment for Previous entries.
theoriginalbit #7
Posted 30 January 2013 - 02:43 AM
the only difference is the original read just loads the previous entries over the current entry…

now after some testing it seems that it works fine for me, the only issue is that you need to redraw all the entries on the screen BEFORE the pullEvent, even before the while. Just as long as its in there.
Henness #8
Posted 30 January 2013 - 02:50 AM
hmm weird I rebooted the computer and it works now… Ya I figured I would have to do that but I was trying to deal with the table thing first. Thanks for the Help.
theoriginalbit #9
Posted 30 January 2013 - 02:57 AM
no problems… maybe this needs to be my opening statement to all :P/>

http://www.youtube.com/watch?v=p85xwZ_OLX0
Henness #10
Posted 30 January 2013 - 03:10 AM
lol, maybe…