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

- Problem Solved -

Started by jahildebra, 26 June 2012 - 05:44 PM
jahildebra #1
Posted 26 June 2012 - 07:44 PM
Problem solved.

Thanks to everyone that helped me out!
Edited on 28 May 2015 - 09:43 PM
archit #2
Posted 26 June 2012 - 09:22 PM
I have never loaded an api from within a program yet, but I would suggest 2 things to check

(1) I am pretty certain you do not need the api/ part in the load path as it checks there by default.

(2) I would assume that the program is on a single thread and needs to wait for the return from loadAPI before continuing. However, that is an assumption, so I would also suggest to put in a sleep command for a few seconds after the load call just to check that it is not being passed on to it's own thread in it's implementation. This at least will verify that assumption real quick.

In any case, the problem is that the fmos is not being loaded correctly, or just not fast enough for the first reference call to it.
MysticT #3
Posted 26 June 2012 - 09:32 PM
(1) I am pretty certain you do not need the api/ part in the load path as it checks there by default.
If it's on the rom/apis folder, it should be loaded by default. Otherwise, you must give the full path, and it will use the filename (not the full path) as the api name.

(2) I would assume that the program is on a single thread and needs to wait for the return from loadAPI before continuing. However, that is an assumption, so I would also suggest to put in a sleep command for a few seconds after the load call just to check that it is not being passed on to it's own thread in it's implementation. This at least will verify that assumption real quick.
There's only one thread for the computer, there's no way for this to happen. When you call a function, the next line will be executed when the function returns.

In any case, the problem is that the fmos is not being loaded correctly, or just not fast enough for the first reference call to it.
Yes, the problem is that the api is not loaded (at least not in the fmos table), this happens when there's an error in the api code. If there was an error loading the api, there should be an error on the screen, just above the one you posted.
archit #4
Posted 26 June 2012 - 09:59 PM
Thanks for clearing that all up MysticT
jahildebra #5
Posted 27 June 2012 - 06:44 PM
Problem solved.

Thanks to everyone that helped me out!
Edited on 28 May 2015 - 09:44 PM