I have a program and it keeps saying there was an error in the window api then shutting down. Any help?
Need help... window:150 string expected got nil
Started by EveryOS, Mar 01 2016 10:26 PM
4 replies to this topic
#1
Posted 01 March 2016 - 10:26 PM
#2
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
A typical mistake of extremely new programmers is to forget to create a string.
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 )
#3
Posted 01 March 2016 - 11:05 PM
It may also mean you set an invalid colour and then later tried to write with it.
#4
Posted 01 March 2016 - 11:56 PM
Quote
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
#5
Posted 02 March 2016 - 12:48 AM
KingofGamesYami, on 01 March 2016 - 10:38 PM, said:
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
Bomb Bloke, on 01 March 2016 - 11:05 PM, said:
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()
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











