USER MANUAL The following errors can only occur with Release 3. FOR type error The type of variable has been used in a FOR loop. The compiler must allocate extra storage for FOR variables. This error happens if the FOR control variable is a formal procedure parameter and the actual parameter is a normal float or integer. e.g. 10 DEFine PROCedure BADFOR(X) 20 FOR X=1 to 10: PRINTX 30 END DEFine 40 A=l 50 BADFOR A A 'For type error' is reported at line 20 because variable A is substituted for X is the procedure. The interpreter would give a 'bad name' error under these circumstances. Overlay table full You have attempted to use too many external files simultaneously either as overlays or resident procedures in one program. Global missing A GLOBAL variable referenced in an external is not present in the root. Page 40 of 100
USER MANUAL CHAPTER 7 MEMORY MANAGEMENT SuperBASIC is privileged among QL jobs in that it is the only one which is allowed to shrink and expand its entire area to suit its needs. EXECutable jobs such as Q_Liberator object programs have to make do with a fixed job area allocated when they are started. If they require more storage then they must use the common heap. The common heap is an area of memory QDOS administers. When a job asks for some memory, QDOS splits off an area of the common heap for the job to use. When a Job is removed, any heap it has borrowed is returned to QDOS. If many jobs are running each using common heap, a problem called heap fragmentation can occur. This is when the heap is split into many small parts none of which are big enough for a given job to use. Q_Liberator is flexible about memory organisation. Object programs can be tailored to confine all data within a job's boundaries, or they can expand into the common heap as required. The choice can be made before a program is compiled by using a compiler directive or after compilation using the utility program QLIB_PATCH. OBJECT PROGRAM STRUCTURE A Q_Liberator object program consists of a code area and a data area. The code area contains the compiled form of the program and parameters associated with it. If you have linked in the runtime system or any assembler routines, then they too are contained within the code area. The data area, contains various control areas described below and storage for variables. Note that it is only the code area that occupies file space on a microdrive. However when the program is loaded into memory, there must be enough space to accommodate both the code and the data. The sizes of the code and data areas are printed at the end of a successful compilation. They can also be obtained by using QLIB_PATCH, whilst the total area occupied by a job in memory can be displayed by the procedure QJ. DATA AREA The following parts of the data area are of interest to the user because their size can be modified: Channel table The size of this table dictates the highest channel number that can be used within a program. It is sensible to keep channel numbers low because a 40 byte entry is reserved for all channels up to the highest which you specify. (This is also true for the interpreter). The number of channels is normally set automatically by the compiler. The minimum Page 41 of 100