-
Notifications
You must be signed in to change notification settings - Fork 3
LIBRARY
LIBRARY string-expression
Load a library into the program. A library is a set of BASIC procedures and functions (PROC/FN) in a separate file which must not contain line numbers. Immediately after the LIBRARY
statement, any procedures or functions in that library will be immediately available.
As it is recommended that BASIC programs load libraries from the standard GLOBAL LIB$
directory, as in the example below:
LIBRARY LIB$ + "/ansi"
LIB$
is a global variable passed from init
which contains an absolute path to a library folder. You can of course ignore this to load locally sourced dependencies if you wish.
If programs which are line-numbered load a library, the library will be auto-numbered with its numbers being after any numbers already in the BASIC program, using increments of 10.
It is recommended to place LIBRARY
statements at or near the start of your program as loading a library is a somewhat expensive operation.
When a library is loaded, Retro Rocket will look for a PROC with the same name as the filename of the library, and call it if it exists. This "constructor" procedure can be used to transparently initialise the state of the library when it is loaded. |
---|
(C) Brainbox.cc 2010-2023
- Home
- Builtin Commands
- Included Programs
-
Creating BASIC programs
- Automatic line numbering
- Variable Naming
- Builtin Variables
- Variable Types
- Builtin Variables
- Parameter types
-
Statements
- BACKGROUND
- CALL
- CHAIN
- CHDIR
- CIRCLE
- CLOSE
- CLS
- COLOUR/COLOR
- CONNECT
- CURSOR
- DEF
- DIM
- ELSE
- END
- ENDIF
- EVAL
- FN
- FOR
- GCOL
- GLOBAL
- GOSUB
- GOTO
- IF
- INPUT
- LET
- LIBRARY
- LINE
- LOCAL
- NEXT
- PLOT
- POINT
- POP
- PROC
- PUSH
- RECTANGLE
- REDIM
- REM
- REPEAT
- RETURN
- SETVARI
- SETVARR
- SETVARS
- SPRITELOAD
- SPRITEFREE
- SOCKCLOSE
- SOCKREAD
- SOCKWRITE
- TRIANGLE
- UNTIL
- WRITE
- YIELD
-
Builtin Functions
-
Integer Functions
- ABS
- ASC
- CHR
- CPUID
- CURRENTX
- CURRENTY
- EOF
- EXISTSVARI
- EXISTSVARR
- EXISTSVARS
- GETNAMECOUNT
- GETPROCCOUNT
- GETPROCCPUID
- GETPROCID
- GETPROCPARENT
- GETSIZE
- GETVARI
- HEXVAL
- INSTR
- LCPUID
- LGETLASTCPUID
- LEN
- MEMFREE
- MEMORY
- MEMUSED
- OCTVAL
- OPENIN
- OPENOUT
- OPENUP
- RADIX
- RGB
- RND
- SHL
- SHR
- SOCKCLOSE
- SOCKREAD
- SOCKSTATUS
- TERMHEIGHT
- TERMWIDTH
- VAL
- String Functions
- Real Functions
-
Integer Functions
- System Libraries