Solved

my pascal program has runtime error 216

Posted on 2000-03-19
3
1,640 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

691 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