Load.logics.v

From AGI Wiki
Jump to navigationJump to search

The load.logics.v command indirectly loads a logic resource onto the memory heap.

Syntax

load.logics.v(var vLOGICNUM);

Remarks

This command loads logic B, where B equals the value of vLOGICNUM, onto the memory heap, keeping it in memory permanently until it gets unloaded (by ending the game, restarting, restoring, or entering a new room). This avoids having to load and unload it each time it is called with the call command.

There is no 'discard logic' command to unload a logic once it is loaded.

AGI adds a script entry to the script stack each time a logic resource is loaded.

Possible Errors

If you attempt to load a logic that does not exist, AGI will raise a runtime error and crash.

Example

Code:
v50 = 75;
call.v(v50);        [ loads and executes logic 75, unloading it after returning
load.logics.v(v50); [  loads logic, and adds script entry
call.v(v50);        [ executes logic, but does not unload it after returning

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 21 (0x15 hex)

See Also

call
load.logics
Memory Management
AGI Scripts