? USE and EXEC ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Creep into the Halloween / Horror Programming Contest (Deadline Extended)

USE and EXEC

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 1you can do: USE "PRG1:LIBRARY"
Author
12Me21
Updated
Rating
1 vote
Categories
Keywords
  • use
  • exec
  • common
  • call
  • var
2 Comment(s) xXOscarXx xXOscarXx Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies 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 xXOscarXx xXOscarXx Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies I found 0.0" USE "PRG1:LIBRARY" A$=CALL("1:MY_FUNC$", "HELLO WORLD") PRINT A$