
Logo Commands
The Workspace
Working with Data
Put data together
Access data
Test data or data contents
Create and manipulate arrays
Read, write, and print data
Working with Properties
Multimedia commands
Put data together
Access data
Test data or data contents
Create and manipulate arrays
Read, write, and print data
Working with Properties
Multimedia commands
Global built-in variables reflect the state of Logo. Some of these variables are read only, while changing others have effects on Logo programs. A few variables are actually property lists whose properties control Logo's behavior.
Controls the conversion of quoted symbols to upper case.
:CASE
:CASE controls the way quoted words are converted to upper case. If :CASE is TRUE, which is the default, Logo converts lowercase quoted words to upper case as they are input to Logo. If :CASE is set to FALSE, the case of quoted words is not changed.
Altering :CASE is the same as altering the CASE
property of the "PREFS
object.
Note that quoted words enclosed in vertical bars, or back-quoted words are not affected.
Contains the current graphics window name.
:CURRENT.GRAPHICS
:CURRENT.GRAPHICS contains the name of the currently active graphics window. Logo has only one Graphics canvas, so :CURRENT.GRAPHICS always outputs GRAPHICS
. This variable is read-only.
Reports the default Logo panel layout
:DEFAULT.LAYOUT
The built-in variable DEFAULT.LAYOUT reports the default layout of all Logo panels, which is the Graphics panel to the top left, the Listener panel to the bottom left, the Editor panel to the top right, and the Help panel to the bottom right.
The menu command Window/Original Logo Layout sets the default layout.
See also :LAYOUT
and :INITIAL.LAYOUT
.
MAKE "LAYOUT :DEFAULT.LAYOUT
Contains the minimum value that two numbers may differ to still be considered to be equal.
:EPSILON
Computer floating point numbers are based on the binary system. If used in the decimal system, they quickly introduce tiny rounding differences caused by the conversion between the decimal and binary formats. Therefore, comparing two numbers for equality may fail unexpectedly. The :EPSILON variable contains the minimum value that two numbers may differ to still be considered to be equal.
Initially, :EPSILON is set to 0, permitting an exact comparison. If you set the number to a small value between 0.1 and 1.0e-16, Logo would perform the expression (ABS :A :B) < :EPSILON instead to determine if two numbers are equal.
It may be beneficial to use :EPSILON together with the :PRECISION
variable. The initial value
of :PRECISION
is 2, causing numbers to be printed with two decimal places. A matching value for
:EPSILON would, therefore, be 0.001.
MAKE "EPSILON 0.001 0.001 = 0.0011 Result: TRUE 0.001 = 0.002 Result: TRUE 0.001 = 0.003 Result: FALSE MAKE "EPSILON 0
Contains the type of the last runtime error.
:ERROR
The built-in variable ERROR works together with the CATCH
and THROW
commands. Whenever Logo throws a word with the THROW
command inside the instruction list of a CATCH
command, or Logo throws a
runtime error, and that error or word is caught, Logo sets :ERROR to the tag of the caught error. The CATCH
command sets the variable to the empty list before executing its instruction list. Please note that there
is a command ERROR
that outputs more detailed information about an error.
Runtime errors set this variable to RUNTIME
.
Reports the text of the last caught runtime error or THROWn word.
:ERRORTEXT
The built-in variable ERRORTEXT works together with the CATCH
and THROW
commands. Whenever Logo throws
a word with the THROW
command inside the instruction list of a CATCH
command, or Logo throws a
runtime error, and that error or word is caught, Logo sets ERRORTEXT to the text of the runtime error, or to
Uncaught THROW: xxx
, where xxx
is the tag that THROW
threw. The CATCH
command sets the variable to the empty list
before executing its instruction list.
See also ERROR
.
TO TEST.ERROR CATCH "ERROR [1 / 0] (PRINT "|Error text:| :ERRORTEXT) END TEST.ERROR Error text: Division by Zero
Defines the way turtles bounce off the edges of the Graphics screen.
:FENCE
There are four ways a turtle can react when it hits the bounds of the Graphics drawing area (see also SETBOUNDS
). It can simply ignore the boundaries (WINDOW), it can stop moving (FENCE), it can bounce off the border (BOUNCE), or it can wrap around and re-enter the window on the opposite side (WRAP). The behavior is defined by setting the variable :FENCE to one of these values. The commands WINDOW
, FENCE
, BOUNCE
and WRAP
all set the :FENCE variable.
Reports or sets the initial Logo panel layout
:INITIAL.LAYOUT MAKE "INITIAL.LAYOUT :LAYOUT
The built-in variable INITIAL.LAYOUT controls the initial layout of all Logo panels. This is the layout of all Logo panels that Logo found after finishing its startup phase. This includes any changes made by an INIT.LGO file that was autoloaded from the classroom server, or any layout that was last saved with Logo's Autosave functionality.
The menu command Window/Initial Layout also sets the initial layout.
See also :LAYOUT
and :DEFAULT.LAYOUT
.
MAKE "INITIAL.LAYOUT :LAYOUT
Reports Logo's UI language.
:LANGUAGE
:LANGUAGE reports the language identifier of the language used by Logo's user interface (UI). If Logo is in English, :LANGUAGE reports “EN_US”, for example.
Gets or sets the panel layout.
:LAYOUT
The LAYOUT
variable contains a list that reflects the entire layout of all Logo panels. The list is a pair of values; the first value is the name of the panel, and the second value is a list containing the values of the panel's LAYOUT
and STATE
properties. You can read this variable and store its value to save a layout, and set the variable back to the stored value to restore the layout at a later time.
:LAYOUT Result: [GRAPHICS [[0 0 100 60] TRUE] LISTENER [[0 60 100 40] TRUE] TOOLBOX [[80 0 20 25] FALSE] FILES [[80 25 20 25] FALSE] HELP [[70 50 30 50] FALSE] EDITOR [[10 10 50 50] FALSE] DEBUGGER [[0 5 100 70] FALSE]]
Contains a property list of global program and system settings.
PLIST "LOGO.ENV
LOGO.ENV contains a property list of program and system settings. Click here for a complete list of properties.
Contains the name of the music synthesizer that Logo uses to play music.
MAKE "MIDI.OUTPUT name
MIDI.OUTPUT contains the name of the music synthesizer that Logo uses to play music. It is one of the names that the :MIDI.OUTPUTS
variable returns.
Returns a list of synthesizer names that Logo supports for playing music.
:MIDI.OUTPUTS
MIDI.OUTPUTS outputs a list of available MIDI synthesizers. Logo uses a MIDI synthesizer to play music commands.
See also PLAY
, and the manual chapter Making Music.
Contains the default file extension for graphics files.
:PICTURE.FORMAT
The built-in variable PICTURE.FORMAT contains the default file extension for graphics files
when no file extension is given. It should be set to any graphics file extension that your browser can load.
On startup, the value is set to PNG
.
Sets the precision in which numbers are printed.
MAKE "PRECISION number
PRECISION is a pre-defined name that sets the number of decimal places displayed
in Logo calculations. The default value of PRECISION when Logo is loaded is 2,
the maximum allowed number is 15. Calculations are always performed using the
full value of the number, regardless of the value of PRECISION. Another way to set
the precision is to set the PRECISION property of the "PREFS
object.
Logo always strips trailing zeroes from a number. If PRECISION is set to 2, the number 2 prints as “2”, not “2.00”.
System-wide properties.
GPROP "PREFS "propertyname PPROP "PREFS "propertyname value PLIST "PREFS
The PREFS object contains a list of system-wide properties that control the look and feel
of Logo. If you SAVE
your workspace, the current settings are stored in the saved file. If you load a workspace that has been saved before, the settings are restored. Click here for a complete list of properties.
Gets or sets the prompt for the Listene.
MAKE "PROMPT text
PROMPT is a small text field in front of the Listener. When setting PROMPT, the text is displayed in that field as a prompt. Setting PROMPT to a list strips the brackets from the list and converts the list to a word.
The number of the input stream.
MAKE "STANDARD.INPUT channel
STANDARD.INPUT is a pre-defined name that controls the source of the standard Logo input
stream. When Logo starts up, the default value of STANDARD.INPUT is 0, which means
that all Logo commands use the Listener for input and output. To change the source of
the input stream to a file, the file must be opened
or created to prepare it for input, and STANDARD.INPUT assigned the channel number
with the value that the OPEN
command returned.
The number of the output stream.
MAKE "STANDARD.OUTPUT channel
STANDARD.OUTPUT is a pre-defined name that controls the destination of the standard Logo output
stream. When Logo starts up, the default value of STANDARD.OUTPUT is 0, which means
that all Logo output is written to the Listener. To change the destination of
the output stream to a file, the device must be opened
or created to prepare it for output, and STANDARD.OUTPUT assigned the channel number
which the value that the OPEN
command returned.
To redirect Logo's input stream, use :STANDARD.INPUT
. See also OPEN
and CREATE
.
Sets the tab stop position.
MAKE "TAB number
The system variable TAB sets the tab stop width used in the Editor and Listener windows.
This width is pre-set to 4 at startup. The value is saved when Logo exits and restored
when Logo starts. Setting TAB is equivalent to setting the TAB property at the
:PREFS
object.
Controls the output of debugging information.
MAKE "TRACE number
TRACE is a pre-defined name that allows monitoring of procedure or command line execution. TRACE displays each step of a procedure in the Listener without pausing as it is run. TRACE can be assigned a combination of the following values:
1 | Procedure calls and the execution of procedures |
2 | Assignments to values |
4 | Assignments to properties |
Do not confuse the built-in variable with the procedure TRACE
. :TRACE takes precedence over the TRACE
command.
Reports the user name for local storage.
:USERNAME
:USERNAME reports the name of the user that Logo uses to address the browser's local storage files. This makes it possible to have a separate storage area for each user. The files stored in the browser's local storage are not visible on disk, but they remain accessible for as long as the user name exists.
If no user has been set, :USERNAME defaults to Guest User
.