Re: [fpc-pascal] Error: Identifier not found "Heap Error"
Thank you all for the help! On Mon, Oct 17, 2016 at 10:51 AM Jonas Maebewrote: > Luiz Gonzaga de Oliveira Neto wrote: > > Would be it be better to try to compile this with the Turbo Pascal > > compiler then? Or do you think it would be easier to try to remove the > > lines with these codes and continue with FPC? My fear is that in some of > > these modifications I change what the code was supposed to do. > > As the link that Bart posted explains > (http://putka.upm.si/langref/turboPascal/0683.html ), HeapError is a > pointer to a function that would be called when you're out of memory. > That happened quite regularly if all you had was 640KB, but it is > extremely unlikely to happen if you are running that same program on the > same inputs on a 32 or even 64 bit platform. > > If that would happen anyway, then by default FPC will terminate your > program with a Run-time error 204. You can then still look at what the > original program did if it ran out of memory and try to do the same in a > more preventative way, if it did not simply use that HeapError function > pointer to print a (more user-friendly) error message and terminate as > well. > > > Jonas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > -- -- Luiz G. de Oliveira Neto -- Unicamp - EC09 --- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
Luiz Gonzaga de Oliveira Neto wrote: > Would be it be better to try to compile this with the Turbo Pascal > compiler then? Or do you think it would be easier to try to remove the > lines with these codes and continue with FPC? My fear is that in some of > these modifications I change what the code was supposed to do. As the link that Bart posted explains (http://putka.upm.si/langref/turboPascal/0683.html ), HeapError is a pointer to a function that would be called when you're out of memory. That happened quite regularly if all you had was 640KB, but it is extremely unlikely to happen if you are running that same program on the same inputs on a 32 or even 64 bit platform. If that would happen anyway, then by default FPC will terminate your program with a Run-time error 204. You can then still look at what the original program did if it ran out of memory and try to do the same in a more preventative way, if it did not simply use that HeapError function pointer to print a (more user-friendly) error message and terminate as well. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
On Mon, 17 Oct 2016, Luiz Gonzaga de Oliveira Neto wrote: Hi all, Thanks for the help. Would be it be better to try to compile this with the Turbo Pascal compiler then? Or do you think it would be easier to try to remove the lines with these codes and continue with FPC? My fear is that in some of these modifications I change what the code was supposed to do. Normally, you can just remove the lines that contain HeapError. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
Hi all, Thanks for the help. Would be it be better to try to compile this with the Turbo Pascal compiler then? Or do you think it would be easier to try to remove the lines with these codes and continue with FPC? My fear is that in some of these modifications I change what the code was supposed to do. Best regards, On Sun, Oct 16, 2016 at 1:12 PM Bartwrote: > On 10/16/16, Mark Morgan Lloyd wrote: > > > I've got a 5.0 manual to hand [blows dust off, coughs]. > > See: http://putka.upm.si/langref/turboPascal/0683.html > > Bart > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > -- -- Luiz G. de Oliveira Neto -- Unicamp - EC09 --- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
On 10/16/16, Mark Morgan Lloydwrote: > I've got a 5.0 manual to hand [blows dust off, coughs]. See: http://putka.upm.si/langref/turboPascal/0683.html Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
On 15/10/16 20:00, Michael Van Canneyt wrote: issues, but I still get the following error: OPTIQAP.PAS(18,21) Error: Identifier not found "HeapError" OPTIQAP.PAS(19,6) Error: Identifier not found "HeapError" This is possibly code intended for Turbo Pascal. The HeapError identifier does not exist in Free Pascal. At least, I have not found any. In some old Free Vision code, I found a reference to HeapError which seems to be a callback function variable, but it is not active for Free Pascal. I suggest you simply remove any lines that contain HeapError. I've got a 5.0 manual to hand [blows dust off, coughs]. The function takes size (bytes?) as parameter, returns 0 by default indicating that a runtime error should be raised, but may alternatively return 1 (New or GetMem should return Nil) or 2 (New or GetMem should retry). Presumably it's in there to allow normal memory management to be augmented with application-specific garbage collection, I've seen this in the Pascal source for a Prolog system (not the Spivey one). Perhaps Michael et al. would confirm this, but I'd expect FPC to use the OS's memory management including virtual memory, so within limits I'd not expect to see memory exhaustion in finite time. The residual use of this function is to return Nil rather than forcing a run-time error if there is an allocation problem. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error: Identifier not found "Heap Error"
On Sat, 15 Oct 2016, Luiz Gonzaga de Oliveira Neto wrote: Hello all, As mentioned in a previous e-mail, I'm having my first contact with Pascal during my Masters research, trying to compile a code provided by a professor. The first mistakes I had regarded the *memavail *and *maxavail* functions, which I've read are not supported anymore. I believe I have overcome these issues, but I still get the following error: OPTIQAP.PAS(18,21) Error: Identifier not found "HeapError" OPTIQAP.PAS(19,6) Error: Identifier not found "HeapError" As I mentioned in the previous e-mail, this code was provided by me by a reputed professor, so I have reasons to believe it's correct. My question is: do you know if this error could be happening due to some version incompatibility or some missing flag during compilation? Or is it probably caused by some mistake in the code? Or would you need more information to answer this? Sorry if the question is silly, as I've mentioned, this is my first contact with Pascal and FPC. This is possibly code intended for Turbo Pascal. The HeapError identifier does not exist in Free Pascal. At least, I have not found any. In some old Free Vision code, I found a reference to HeapError which seems to be a callback function variable, but it is not active for Free Pascal. I suggest you simply remove any lines that contain HeapError. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Error: Identifier not found "Heap Error"
Hello all, As mentioned in a previous e-mail, I'm having my first contact with Pascal during my Masters research, trying to compile a code provided by a professor. The first mistakes I had regarded the *memavail *and *maxavail* functions, which I've read are not supported anymore. I believe I have overcome these issues, but I still get the following error: OPTIQAP.PAS(18,21) Error: Identifier not found "HeapError" OPTIQAP.PAS(19,6) Error: Identifier not found "HeapError" As I mentioned in the previous e-mail, this code was provided by me by a reputed professor, so I have reasons to believe it's correct. My question is: do you know if this error could be happening due to some version incompatibility or some missing flag during compilation? Or is it probably caused by some mistake in the code? Or would you need more information to answer this? Sorry if the question is silly, as I've mentioned, this is my first contact with Pascal and FPC. Thanks in advance for any help, -- -- Luiz G. de Oliveira Neto -- Unicamp - EC09 --- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal