Jump to content




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


  • You cannot reply to this topic
9 replies to this topic

#1 Henness

  • Members
  • 189 posts

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

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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...

#3 Henness

  • Members
  • 189 posts

Posted 30 January 2013 - 02:27 AM

Nope still doesn't work.

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 30 January 2013 - 02:29 AM

Typo:
_tCurrentInput
vs.
_CurrentInput

#5 Henness

  • Members
  • 189 posts

Posted 30 January 2013 - 02:33 AM

sorry changed that while you were looking at it check it again please.

#6 Henness

  • Members
  • 189 posts

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.

#7 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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.

#8 Henness

  • Members
  • 189 posts

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.

#9 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 30 January 2013 - 02:57 AM

no problems... maybe this needs to be my opening statement to all :P



#10 Henness

  • Members
  • 189 posts

Posted 30 January 2013 - 03:10 AM

lol, maybe...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users