Peter N Lewis wrote:
Does New as a function return nil or does it still give a runtime error?
Runtime error.
If I want to allocate memory, but handle it gracefully if it fails, what are the recommended approaches?
You could call GetMemPtr directly (with all the drawbacks of using GetMem vs. New, as you know), or install your own allocator (wrapper) which returns `UndocumentedReturnNil' (as, e.g. BPGetMem in the System unit does). As the name indicates, this was really a quick kludge, added to support this BP compatibility unit ... I don't think we have a really nice way to do it ATM. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8