🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Duane Williams Mon, 25 Mar 1985 01:33
NewHandle/MemError in Modula-2
#993
Author: Duane Williams
Date: Mon, 25 Mar 1985 01:33
25 lines
2065 bytes
I am having trouble using desk accessories from Modula-2.  Inside Mac suggests
checking whether sufficient memory is available before trying to load desk
accessories.  After determining the size of the desk accessory resource, one
is supposed to call NewHandle and then check whether it returns NIL.  If it
does then there isn't room for the desk accessory; otherwise there is.  I've
had no trouble with this when using SUMacC, but it doesn't work from Modula-2.

The trouble seems to be that NewHandle does not always return NIL when it
should, and sometimes returns NIL when it shouldn't.  It behaves differently
depending on whether my program is run by double-clicking its icon on the
desktop or whether I run it using the Execute item in the Transfer menu in
the Linker.  A different interpreter is used in the two cases!  (This is
obviously a big mistake.)

I've tried using MemError after calling NewHandle, hoping that MemError
would give more reliable status information, but MemError appears to be
broken also.  It should return either NoErr (0) or MemFullError (-108).
Instead it returns various values, depending on how I execute my program,
but seldom returns the correct value.  Sometimes it returns 18, which is
(suspiciously) the value of MemoryManagerModNum.

Have other people had better luck using NewHandle and MemError from Modula-2?
-- 
uucp: ..!seismo!cmu-cs-k!dtw
arpa: dtw@cmu-cs-k.ARPA
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads