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

How To Have A Program Return A Value

Started by crazyadam0, 16 November 2013 - 05:58 PM
crazyadam0 #1
Posted 16 November 2013 - 06:58 PM
I am making a graphical shell and i have a log in function. I can use it as a function just fine but it brought up the question of could i have a log in program ran from the main program that returned if the log in was valid? i was wondering how to do this but i couldn't find a way to make programs return a value. is it possible to do something like shell.run("/returntest"); and have it return a value in the program returntest. (I know you cant use shell.run because that returns true or false depending on if it was successful) Is there a function to do this?
Bomb Bloke #2
Posted 16 November 2013 - 07:14 PM
This is what APIs are for: Set the login program up as one, load it, call its functions, then unload it if you so choose.
crazyadam0 #3
Posted 16 November 2013 - 11:42 PM
Thats a good idea thank you!