Pascal Run Time Error 103: cannot - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Pascal Run Time Error 103: cannot

- TP 6.0 Program generates the Error 103 (FIle not Open)
- Error 103 generated after a simple 'WRITELN;' statement which is supposed to put an empty line on the screen. This occurs right after the start of the program.


- error occurs only on: i) old 286 IBM AT and ii) Pentium I (90 MHz) computer
- earlier versions of same program ran smoothly

- the error does not occur on my Pentium-II 350 MHz computer on which the programming is done

Comments

  • : - TP 6.0 Program generates the Error 103 (FIle not Open)
    : - Error 103 generated after a simple 'WRITELN;' statement which is supposed to put an empty line on the screen. This occurs right after the start of the program.
    :
    :
    : - error occurs only on: i) old 286 IBM AT and ii) Pentium I (90 MHz) computer
    : - earlier versions of same program ran smoothly
    :
    : - the error does not occur on my Pentium-II 350 MHz computer on which the programming is done

    as best i know, the error "file not open" is only when you do something like: [code]
    write(f,'....');

    [/code]
    where f is a var of any file type, or specifically [italic]writeln()[/italic] for text, and you didn't [italic]append()[/italic] or [italic]rewrite()[/italic] the file.. or if you already [italic]close()[/italic]ed the file..

    but that will happen on all computers, and all tp/other compiler versions which support file i/o (which should be all) (if it does not support that, it won't recognize the code..)

    try finding TP7 is basically what i'd suggest.. i don't have a 286 or a p1/90 and i dont' have problems on my p3/450..

    //Noam

  • : : - TP 6.0 Program generates the Error 103 (FIle not Open)
    : : - Error 103 generated after a simple 'WRITELN;' statement which is supposed to put an empty line on the screen. This occurs right after the start of the program.
    : :
    : :
    : : - error occurs only on: i) old 286 IBM AT and ii) Pentium I (90 MHz) computer
    : : - earlier versions of same program ran smoothly
    : :
    : : - the error does not occur on my Pentium-II 350 MHz computer on which the programming is done
    :
    : as best i know, the error "file not open" is only when you do something like: [code]
    : write(f,'....');
    :
    : [/code]
    : where f is a var of any file type, or specifically [italic]writeln()[/italic] for text, and you didn't [italic]append()[/italic] or [italic]rewrite()[/italic] the file.. or if you already [italic]close()[/italic]ed the file..
    :
    : but that will happen on all computers, and all tp/other compiler versions which support file i/o (which should be all) (if it does not support that, it won't recognize the code..)
    :
    : try finding TP7 is basically what i'd suggest.. i don't have a 286 or a p1/90 and i dont' have problems on my p3/450..
    :
    : //Noam
    :

    There is away of handling this....

    I had just recently had to do this re opening a file...

    Like write('Enter file name :);
    readln(filename);

    {I+} {Note this is used, it overrides the dos error interruption program}

    assgin(f,{the location of file ie c:tpin));
    reset(f);

    {I-} {Restores dos error handling}

    if {I am not sure of the name here} errorresult then
    writeln('File not found.');
    else
    writeln('File found.');

    The above errorresult returns a value and U then have contorl of what is happening.

    I shall go home and check this variable name and report it back to you..

    Michael


  • : : : - TP 6.0 Program generates the Error 103 (FIle not Open)
    : : : - Error 103 generated after a simple 'WRITELN;' statement which is supposed to put an empty line on the screen. This occurs right after the start of the program.
    : : :
    : : :
    : : : - error occurs only on: i) old 286 IBM AT and ii) Pentium I (90 MHz) computer
    : : : - earlier versions of same program ran smoothly
    : : :
    : : : - the error does not occur on my Pentium-II 350 MHz computer on which the programming is done
    : :
    : : as best i know, the error "file not open" is only when you do something like: [code]
    : : write(f,'....');
    : :
    : : [/code]
    : : where f is a var of any file type, or specifically [italic]writeln()[/italic] for text, and you didn't [italic]append()[/italic] or [italic]rewrite()[/italic] the file.. or if you already [italic]close()[/italic]ed the file..
    : :
    : : but that will happen on all computers, and all tp/other compiler versions which support file i/o (which should be all) (if it does not support that, it won't recognize the code..)
    : :
    : : try finding TP7 is basically what i'd suggest.. i don't have a 286 or a p1/90 and i dont' have problems on my p3/450..
    : :
    : : //Noam
    : :
    :
    : There is away of handling this....
    :
    : I had just recently had to do this re opening a file...
    :
    : Like write('Enter file name :);
    : readln(filename);
    :
    : {I+} {Note this is used, it overrides the dos error interruption program}
    :
    : assgin(f,{the location of file ie c:tpin));
    : reset(f);
    :
    : {I-} {Restores dos error handling}
    :
    : if {I am not sure of the name here} errorresult then
    : writeln('File not found.');
    : else
    : writeln('File found.');
    :
    : The above errorresult returns a value and U then have contorl of what is happening.
    :
    : I shall go home and check this variable name and report it back to you..
    :
    : Michael
    :
    :
    I am at home checked the program

    if IORESULT= 0 then the file doesn't exsist

    and I have {I+} and {I-} in the wrong order

    sorry as I am at the libary without my own computer when doing the above
    My memory isn't as good.

    Michael


  • Just a thought, are either of the AT or p90 machines short of free
    file handles (config.sys files=) ?
    Could there have been any changes in device drivers/tsr's since
    the program last ran ok?
    Have you changed to a different version of TP?

    Just another thought.. Do most people find it beneficial to have all
    prior message trails included in the next response?

Sign In or Register to comment.