2.1.3. Miscellaneous Routines

Version II.0, February 1979

2.1.3.1. Sizeof

page127 FUNCTION SIZEOF(variable): INTEGER;
FUNCTION SIZEOF(type-name): INTEGER;

This function returns the number of bytes that the “item” passed as a parameter occupies. SIZEOF is particularly useful for FILLCHAR, MOVELEFT and MOVERIGHT intrinsics.

2.1.3.2. Log

FUNCTION LOG(NUMBER: REAL): REAL;

This function returns the log base ten of the NUMBER passed as a parameter.

2.1.3.3. Time

PROCEDURE TIME(VAR HIWORD, LOWORD: INTEGER); (* may not be implemented in all machines *)

This procedure returns the current value of the system clock. It is in 60ths of a second. (This is somewhat hardware-dependent; we assume a 16-bit integer size and 32-bit clock word. The HIWORD contains the most significant portion.

Warning: The sign of the LOWORD may be negative since the time is represented as a 32-bit unsigned number.) The HIWORD and LOWORD must be VARiables of type INTEGER.

2.1.3.4. Pwroften

FUNCTION PWROFTEN(EXPONENT: INTEGER): REAL;

This function returns the value of 10 raised to the EXPONENT power. EXPONENT must be an integer in the range 0 to 37.

2.1.3.5. Mark

PROCEDURE MARK(VAR HEAPPTR: ^INTEGER);

2.1.3.6. Release

PROCEDURE RELEASE(VAR HEAPPTR: ^INTEGER);

These procedures are used for returning dynamic memory allocations to the system. HEAPPTR is of type ^INTEGER. MARK sets HEAPPTR to the current top-of-heap. RELEASE sets top-of-heap pointer to HEAPPTR.

2.1.3.7. Halt

PROCEDURE HALT;

This procedure generates a HALT opcode that, when executed, causes a non-fatal run-time error to occur. At this point in execution, the Debugger is invoked, therefore, if the Debugger is not in core when this occurs, a fatal run-time error, #114, will occur.

2.1.3.8. Gotoxy

PROCEDURE GOTOXY(XCOORD, YCOORD: INTEGER);

page128 This procedure sends the cursor to the coordinates specified by (XCOORD, YCOORD). The upper left corner of the screen is assigned to be (0,0). This procedure is written to default to a Datamedia-type terminal. If your system uses other than a Datamedia or Terak 8510a, you will need to bind in a new GOTOXY using the GOTOXY package described in Section 4.7.

2.1.3.9. Memavail

FUNCTION MEMAVAIL: INTEGER;

This function returns the number of words currently between the top-of-stack and top-of-heap. This can be interpreted as the amount of memory available at that time. One must take into consideration the size of evaluation stacks, and error-procedure calls. page129 page130


This page last regenerated Sun Jul 25 01:11:47 2010.