Jump to content




How to make funcitons that use handles


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

#1 Gumball

  • Members
  • 254 posts
  • LocationFairbanks, Alaska

Posted 14 December 2014 - 10:39 PM

I want to learn how to create a handle, like on file = fs.open("test","r") file:readLine(). I can't figure out how to make them.

Thanks,
-bluebird

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 14 December 2014 - 10:44 PM

the 'handles' which are returned by opening files or requesting from the internet are nothing special, they're just tables with functions in them.

Edited by theoriginalbit, 14 December 2014 - 10:44 PM.


#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 14 December 2014 - 10:51 PM

If you read the source code for the "vector" or "window" APIs, you'll probably find what you're after.

#4 Gumball

  • Members
  • 254 posts
  • LocationFairbanks, Alaska

Posted 18 December 2014 - 01:02 AM

K thanks, ill take a look at that :D





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users