MC-Basic:LOAD

From SoftMC-Wiki
Revision as of 03:38, 25 April 2022 by Hallel (talk | contribs) (Minor changes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This command loads a programs and libraries from the flash memory into RAM, from where it may be executed. During the process, the program or library is checked for syntax errors. Syntax errors are written to the TRN.ERR file, which may be retrieved to see which errors occurred. Only programs without syntax errors may be executed. Programs are executed using the STARTTASK command. The Priority sets the <priority level> at which the task is run within the system. The highest priority is 1, which causes the task to be run after all realtime tasks have run. The lowest priority is 16. Tasks with the same priority level run using a round-robin procedure, which gives equal time to each task. A low priority task cannot interrupt a high priority task.

The StackSize optional parameter sets the size of local (Dim) variables’ stack. Its value is a actually a floating point multiplier of an internal basic stack size.  This basic stack size is the lowest size allowed for local data stack (when size multiplier is 1), whereas the highest value depends on the amount of free memory available.

From Version MULTIBUS 0.4.15.8, with functionality allows to load a task together with libraries which are automatically included in the loaded task.

When used in CONFIG.PRG, loading a library is equivalent to using LOADGLOBAL for loading a global library.

NOTE-Info.svgNOTE
The command line operates at priority level 2. If a task is started at priority level 1, the command line is not operable until the task ends or until it releases the CPU.

Syntax

Load <filename> {Priority = <priority level>} {StackSize = <stacksize multiplier>} {with <libraryName>, <libraryName>,<libraryName>... }

Availability

All versions

Type

<filename>: File specification, including file name and extension.
<priority level>: Long

<stacksize multiplier>: Double

<libraryName>: File specification, including file name and extension

Range

<filename>: The file must exist in the flash memory.
<libraryName>: The file must exist in the flash memory.
<priority level>: 1 to 16

<stacksize multiplier>:1 to MaxDouble

Default

<priority level>: 16

<stacksize multiplier>:1

Scope

Task, library or Terminal      for programs and IMPORTED ( local ) libraries

Configuration             for global libraries

Limitations

The only limitation is free memory space. The largest block of free memory may be queried using the SYSTEM.MAXMEMBLOCK query.

Examples

Load MAKECUT.PRG

Load myTask1.PRG with myLib1.lib

Load myTask.PRG with myLib1.lib, mylib2.lib, mylib3.lib

Load LIBRARY1.LIB

See Also