Programmer's Reference
Once a PlatformFunction has been created, it can be called using
call, callWith:,
callWith:with:, and so on. The number of
arguments in the call must match the number of arguments in the
PlatformFunction.
For example, to call the DosBeep function described above, you might use
the following statement:
rc := dosBeep callWith: 100 with: 200
The call to a PlatformFunction can fail and
cause a walkback for the following reasons:
- Invalid argument count
- The number of parameters in the PlatformFunction is not the
same as the number of parameters in the call.
- Invalid class
- The parameter could not be converted because its class is invalid (for
example, trying to pass a Float in an int32
parameter). All such type conversions must be done explicitly (for
example, pass the Float truncated as the
parameter).
- Value out of range
- The Character or Integer value is not in the range
allowed for the type (see above for the ranges).
- Not enough memory
- There is insufficient memory to allocate a LargeInteger for the
return value of the function.
- Operating system error
- An operating-system-specific error occurred; for example, it could
not find the shared library or the function in the library.
Note: | Calling a PlatformFunction with invalid arguments may result in a
system crash. You need to ensure the validity of the arguments.
|
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]