749 posts
Location
BOO!!
Posted 01 March 2016 - 10:26 PM
I have a program and it keeps saying there was an error in the window api then shutting down. Any help?
3057 posts
Location
United States of America
Posted 01 March 2016 - 10:38 PM
When the window API errors, you can bet you're passing the term API an invalid value on an advanced computer. Since the only term functions that require a string are term.write and term.blit, I would guess you are passing nil as the first value to one of those two functions. If you want the line number in your program, simply disable the window API by adding
term.redirect( term.native() )
to the top of your program. This will not be a solution if you are using a window.
A typical mistake of extremely new programmers is to forget to create a string.
--#correct:
term.write( "Hello" )
--#incorrect:
term.write( Hello )
7083 posts
Location
Tasmania (AU)
Posted 01 March 2016 - 11:05 PM
It may also mean you set an invalid colour and then later tried to write with it.
749 posts
Location
BOO!!
Posted 01 March 2016 - 11:56 PM
It may also mean you set an invalid colour and then later tried to write with it.
Doing that would just straight out shut down the computer before it even gets to the write part
957 posts
Location
Web Development
Posted 02 March 2016 - 12:48 AM
Since the only term functions that require a string are term.write and term.blit, I would guess you are passing nil as the first value to one of those two functions
It may also mean you set an invalid colour and then later tried to write with it.
Actually, since
line 150 of the window API has to do with the text color of a line, I'd suspect
term.setTextColor()