Re: Open command in wxEuphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jesse Adkins wrote:
> 
> I don't know how to stop append_text from getting the text in the file so, it
> eventually tries to go past what is in the file, generating a new error...
> 
> type_check failure, val is -1
> 
> I don't know how to stop the code from hitting the bottom or to check for -1.
> I've tried to set val as something and then an if statement to make it stop
> when it hits -1 but it passes it up.

When gets reaches the end of the file, it returns -1.  You need to change 
your read loop to:
in = gets(fn)
while sequence(in) do
	append_text(M,in)
	in = gets(fn)
end while


Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu