?
Solved

my pascal program has runtime error 216

Posted on 2000-03-19
3
Medium Priority
?
1,668 Views
Last Modified: 2008-02-26
I wrote a pascal program that is used to store member and book of a book shop
I am now writing a procedure to save and load files in the program that use a single link list to store

There is no problem on saving to a file from the link list records
but when I load the saved file to the link list there is an runtim error 216 occur

do anybody can help me ? please give me your email address so that I can send the source code to you to have a look
0
Comment
Question by:adrianmak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 150 total points
ID: 2633304
Error code 216 means that there is a general protection fault.

Here's what the Pascal help says.

 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
 ³ General Protection fault  ³
 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

This error results if you try to access memory that is not legal for your
application to access. The operating system halts your application and tells
you that a general protection (GP) fault occurred, but your system does not
crash.

The following practices cause GP faults:

 * Loading constant values into segment registers

 * Performing arithmetic operations on segment registers of selectors

 * Using segment registers for temporary storage

 * Writing to code segments

 * Accessing memory beyond the local address space given to your application

 * Derefencing nil pointers

I think you have to look through your code one more time, or maybe try to run it on another computer. If it works ok there, it could be something wrong with the setup on your PC.

Regards
Batalf

0
 

Author Comment

by:adrianmak
ID: 2634755
I have a procedure that is open an existing file for read in

assign(memberfile,'member.txt')
reset(memberfile)

{ read(member,newnode^.id,newnode^.name);

..
..
..
..

writeln(newnode^.id,newnode^.name);



when I run the program
error 104: file not open for input

what wrong ?
0
 
LVL 49

Expert Comment

by:dbrunton
ID: 2639054
That's really another question you are asking.

What I am suspecting is that you have declared memberfile to be a file of text.  In which case using reset means that you can only open the file for reading.  You are trying to write to the file hence the error.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question