Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

input past end of file error

BravoknightBravoknight Member Posts: 35
i keep getting this while im using my open "WHATEVER" for output/input as #X(x is a number 1-5) how can i stop this error,fix it, or whatever

Comments

  • cancereacancerea Member Posts: 1
    : i keep getting this while im using my open "WHATEVER" for output/input as #X(x is a number 1-5) how can i stop this error,fix it, or whatever
    :

    This error comes when you r trying to acces a file, whose filepointer is not yet set.


    You give me the fragment of code, so that I tell you where exectly the problem is.....
  • billywm664billywm664 Member Posts: 176
    You get this error when you try to take input past the end of the file. In other words, you try to read more than what's there.
    Generally, this only happens with input, not output. If you do in fact get the error with an OUTPUT file, it may be misreporting the error. Make sure the file you're reading/writing to is not used by another program, write protected, and so on.

    the EOF() function can detect the end of file.
    An example program might look like this:

    [code]
    open "whatever.ext" for input as #1
    do while not eof(1)
    input #1, a$
    loop
    close
    end
    [/code]

    No, it doesn't do anything.. just reads the file. But it doesn't go past the end of file because the loop it set to terminate when EOF is reached.

    : i keep getting this while im using my open "WHATEVER" for output/input as #X(x is a number 1-5) how can i stop this error,fix it, or whatever
    :

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _____ || http://forcoder.org || free ebooks and video tutorials about \ R, Objective-C, C, Visual Basic .NET, Scratch, MATLAB, PL/SQL, C++, Go, PHP, Python, Assembly, Delphi, C#, Perl, JavaScript, Visual Basic, Ruby, Java, Swift Dart, Ada, Apex, Transact-SQL, Clojure, Erlang, COBOL, Fortran, Crystal, Hack, Alice, SAS, Prolog, Lisp, Awk, Julia, Bash, Logo, D, Scheme, Scala, LabVIEW, VBScript, Rust, ABAP, Lua, Kotlin, FoxPro, F#, ML \ ____

Sign In or Register to comment.