LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

USE and EXEC

Root / Submissions / [.]

12Me21Created:
The USE and EXEC keywords let you use other program slots. USE will compile the slot, which lets you use COMMON functions, access all of its functions with CALL "slot:name", and access variables (but not arrays) with VAR("slot:name"). EXEC compiles and executes the code, so it lets you do everything USE can do, along with running the code. Both of these will prevent you from using PRG commands on the slot. Both commands have two syntaxes. You can either give the slot number (0-3) or a filename "PRGslot:filename" which will be loaded into that slot without any dialog. For example, instead of:
LOAD "PRG1:LIBRARY",FALSE
USE 1
you can do:
USE "PRG1:LIBRARY"

Thanks for thin useful intro to USE and EXEC! I did a very small test and, sadly, I fail :(
USE "PRG1:LIBRARY"
A$=CALL("PRG1:MY_FUNC$", "HELLO WORLD")
PRINT A$
Return: Undefined function in 0:2 The "LIBRARY" file has only one function:
DEF MY_FUNC$(TEXT$)
 RETURN TEXT$
END

Replying to:xXOscarXx
Thanks for thin useful intro to USE and EXEC! I did a very small test and, sadly, I fail :(
USE "PRG1:LIBRARY"
A$=CALL("PRG1:MY_FUNC$", "HELLO WORLD")
PRINT A$
Return: Undefined function in 0:2 The "LIBRARY" file has only one function:
DEF MY_FUNC$(TEXT$)
 RETURN TEXT$
END
I found 0.0"
USE "PRG1:LIBRARY"
A$=CALL("1:MY_FUNC$", "HELLO WORLD")
PRINT A$