FANDOM


Syntax

LOAD filename

LOAD filename.ext

(LOAD)

Explanation

LOAD transfers the contents of the file specified by its input from the disk to the workspace. The entire file is treated as though it were typed from the keyboard. LOAD outputs TRUE if the file is successfully loaded; otherwise, it outputs FALSE.

Note that the file still exists on the disk; only a copy of it has been transferred to the workspace.

If no file name extension is specified, LOAD loads the file filename.LGO. To load a file that has no extension, a period is necessary after the filename.

If LOAD is used without any inputs, a dialog box will pop up, letting you select the file to be loaded. The dialog box also pops up if the file name contains any wild card characters like * or ?. In this case, the contents of the dialog box are preset to the file name specification.

Drive specifiers (A:, B:, etc.) can be used with LOAD, but all colons must be preceeded with backslash (\). If a drive specifier is not used, LOAD loads a file from the currently selected drive.

Function key F9 is equivalent to LOAD when Logo is first started.

See also LOADPIC, SAVE, and SAVEPIC.

Examples

? LOAD "SHAPES

Loading from file SHAPES.LGO

SQUARE is defined.

CIRCLE is defined.

TRIANGLE is defined.

Result: TRUE

? LOAD "B\:ALPHABET

Loading File: ALPHABET.LGO

A is defined.

B is defined.

C is defined.

Result: TRUE

?

If LOAD is used within a procedure, its output (TRUE or FALSE) must be redirected so it will not print on the screen. The procedure below prints text, loads a file, and assigns its output as the value of STUFF so that TRUE or FALSE will not display. Compare it to the result of the preceding example.

? TO HIDELOAD

> MAKE "STUFF LOAD "ALPHABET

? END

HIDELOAD defined.

? HIDELOAD

Loading File: ALPHABET.LGO

A is defined.

B is defined.

C is defined.

?

To hide individual procedure names as a file loads, see the LOADIT procedure in the explanation of OPEN.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.