Help With An Error
- Posted by Christopher B <president at insight-concepts.com> Jun 26, 2002
- 370 views
Hi All, I have a small problem I need help with. I have a procedure that= opens a file and reads text from four separate lines. Example: procedure int_command() sequence command, port,arg1,arg2,arg3,temp integer fn, message command = "0" arg1 = "0" arg2 = "0" arg3 = "0" fn =0 fn = open("example.dat", "r") if fn = -1 then message = message_box( "Where is example.dat?\n"&"Program is= shutting down!","Missing Dat File" , MB_ICONHAND+MB_TASKMODAL ) closeWindow(MainWin) else temp = gets(fn) command = temp[1..length(temp) - 1] temp = gets(fn) arg1 = temp[1..length(temp) - 1] temp = gets(fn) arg2 = temp[1..length(temp) - 1] temp = gets(fn) arg3 = temp[1..length(temp) - 1] close(fn) end if end procedure It works okay if there are four lines to read, but if the file= only has three or less lines I get an error: type_check failure, temp is -1 If I use: if temp=-1 then =85ect..ect.... I get an error: true/false= condition must be an ATOM Any suggestions from preventing the type_check error? Thanks, Chris