Recent

Author Topic: Runtime error 103  (Read 5914 times)

melas

  • Newbie
  • Posts: 2
Runtime error 103
« on: June 16, 2013, 11:40:01 pm »
Hello, i am making a program that takes a sentece from a char file and then using some functions, it has to show if the sentence is palindrome.
Examples of palindrome senteces is :
 "A dog! A panic in a pagoda!"

Well now talking about the code, when I execute it, appears a messege of runtime error 103. And it remarked this:

write(temp,dato);

That file is open, so i dont know why is the problem.
Here is the code:  pastebin.com/tHuJkvF7

I wish someone can help me
Thanks for all

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Runtime error 103
« Reply #1 on: June 17, 2013, 12:17:26 am »
IMO problem is on line 43:
Code: [Select]
close(temp);You close the file "temp" and then your recursive routine tries to write there again. I just commented that line and "Runtime error 13" disappeared.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

melas

  • Newbie
  • Posts: 2
Re: Runtime error 103
« Reply #2 on: June 17, 2013, 12:47:27 am »
IMO problem is on line 43:
Code: [Select]
close(temp);You close the file "temp" and then your recursive routine tries to write there again. I just commented that line and "Runtime error 13" disappeared.

Thanks for your help, I put that because I though that the file would clouse once the recursive routine finished.
Thanks again!

 

TinyPortal © 2005-2018