Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - error_def (5)

NAME

error/def - Define a new error type

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

error/def [name]
error/def [name], [desc]

DESCRIPTION

Creates a new error type object underneath .prose.error.module_name, where module_name is the name of the current module.

The name argument provides the name of the error node to create, and the desc argument provides an optional description of the error.

The name may be a dot-separated path if the node is to be created underneath a subcontainer. If the path doesn’t already exist, it will be created. If a dot needs to be used in a name then prefix it with a backslash character (\).

If desc is a register containing the type PSUNIT_TYPE_STRING and the instruction does not generate an error, then the register will be cleared as the byte string is now referenced by the new error type object.

ERROR HANDLING

A runtime error occurs if the arguments are the wrong type.

EXAMPLES

error/def [ArrayTooBig], [Not enough memory for array operation]
  Creates a new module error called ArrayTooBig.

SEE ALSO

pal_commands(5), pal_indices(5), ps_errortypes(5), error_now(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2013 Mark R. Bannister <cambridge@users.sourceforge.net>.

This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


PAL 1.0 error_def (5) 8 March 2013
Generated by manServer 1.07 from man5/error_def.5 using man macros.