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

How to make funcitons that use handles

Started by Gumball, 14 December 2014 - 09:39 PM
Gumball #1
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
theoriginalbit #2
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 on 14 December 2014 - 09:44 PM
Bomb Bloke #3
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.
Gumball #4
Posted 18 December 2014 - 01:02 AM
K thanks, ill take a look at that :D/>