Quick Reference Guide

Commands

The Workspace

All kinds of commands related to the workspace.

ABOUT
A user-defined procedure to display information about your program.
ALIAS old-name new-name
Defines alias names.
BYE
(QUIT, EXIT) Ends Logo.
CHAR number
Converts a number into a Unicode character.
CLEARTEXT
(CT) Clears the Listener pane.
DATE
Reports the date.
FULLSCREEN
(FS) Switches to the Full Screen perspective
HELP commandname
Displays help for a command.
LMAKE varname value
(LOCALMAKE) Create and set a local name.
LOAD filename
LOAD filename.ext
LOAD [extensions-list]
(LOAD)
Loads a file into Logo.
MAKE name object
Assigns a value to a name.
MILLISECONDS
Outputs the number of milliseconds spent.
NAME object name
Assigns a value to a name.
PHELP propertyname
Displays help for a property.
QUOTE word
Quotes its input.
RESTART
(RESTART TRUE)
Erases everything and restarts Logo.
SAVE filename
SAVE [extensions-list]
(SAVE)
Saves the workspace to disk.
SPLITSCREEN
(SS) Makes both the Output panel and the Graphics canvas visible.
TEXTSCREEN
(TS) Minimizes the Graphics canvas and maximizes the Output panel.
THING word
Reports the value of a name.
TIME
Outputs the time.
UNICODE character
ASCII character
Converts a character into its Unicode value.
VERINFO
Outputs Logo version information as a list.
VERSION
(VER) Outputs the Logo version.
WHEN [name propertyname compare-to value] [runlist]
WHEN [name propertyname] [runlist]
WHEN [name] [runlist]
WHEN [name propertyname compare-to value] []
WHEN [name propertyname] []
WHEN [name] []
(WHEN [property-condition])
(WHEN)
Monitors a change to a Logo property or to a Logo event.
WHENEVER [name propertyname compare-to value] [runlist]
WHENEVER [name propertyname] [runlist]
WHENEVER [name] [runlist]
WHENEVER [name propertyname compare-to value] []
WHENEVER [name propertyname] []
WHENEVER [name] []
(WHENEVER [property-condition])
(WHENEVER)
Monitors changes to a Logo property or to a Logo event.

Built-in variables

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.

PLIST "LOGO.ENV
Contains a property list of global program and system settings.
GPROP "PREFS “propertyname
PPROP "PREFS “propertyname value
PLIST "PREFS
System-wide properties.
:CASE
Controls the conversion of quoted symbols to upper case.
:CURRENT.GRAPHICS
Contains the current graphics window name.
:DEFAULT.LAYOUT
Reports the default Logo panel layout
:EPSILON
Contains the minimum value that two numbers may differ to still be considered to be equal.
:ERROR
Contains the type of the last runtime error.
:ERRORTEXT
Reports the text of the last caught runtime error or THROWn word.
:FENCE
Defines the way turtles bounce off the edges of the Graphics screen.
:INITIAL.LAYOUT
MAKE “INITIAL.LAYOUT :LAYOUT
Reports or sets the initial Logo panel layout
:LANGUAGE
Reports Logo's UI language.
:LAYOUT
Gets or sets the panel layout.
MAKE “MIDI.OUTPUT name
Contains the name of the music synthesizer that Logo uses to play music.
:MIDI.OUTPUTS
Returns a list of synthesizer names that Logo supports for playing music.
:PICTURE.FORMAT
Contains the default file extension for graphics files.
MAKE “PRECISION number
Sets the precision in which numbers are printed.
MAKE “PROMPT text
Gets or sets the prompt for the Listene.
MAKE “STANDARD.INPUT channel
The number of the input stream.
MAKE “STANDARD.OUTPUT channel
The number of the output stream.
MAKE “TAB number
Sets the tab stop position.
MAKE “TRACE number
Controls the output of debugging information.
:USERNAME
Reports the user name for local storage.

Contents lists

Contents list commands manipulate several items at once using structured contents lists. Such a list is a three-element list, which are again lists. The first element is a list of all affected procedures, the seconds a list of all names, and the third a list of all properties.

Note: All editing commands like EDIT or EDITFILE can only be used as a direct command, and not from within a procedure. Also, the editor is not available in a published Logo application.

BURIED
Outputs a structured contents list of all buried elements.
BURIED? name
(BURIEDP) Outputs TRUE if the element described by its input is buried.
BURIEDNAMES
Outputs a list of all buried names.
BURIEDPROCS
Outputs a list of all buried procedures.
BURIEDPROPS
Outputs a list of all buried property lists.
BURY procedureName
BURY [procedureName, procedureName, …]
BURY contents-list
(BURY procedureName procedureName …)
Makes names and procedures invisible.
BURYALL
Makes all names and procedures invisible.
BURYNAME name or list
Makes one or more names invisible.
BURYNAMES
Makes all names invisible.
BURYPROC name or list
Makes one or more procedures invisible.
BURYPROCS
Makes all procedures invisible.
BURYPROP name or list
Makes one or more property lists invisible.
BURYPROPS
Makes all property lists invisible.
CONTENTS
(CO) Outputs a complete structured contents list.
EDALL
Edits the entire Logo workspace.
EDIT “name
EDIT [name1 name2 name3 . . .]
EDIT [structured contents list]
EDIT CONTENTS
EDIT NAMES
EDIT PROCEDURES
EDIT PROPERTIES
(EDIT)
Edits parts or all of the Logo workspace.
EDN name or list
Edits one or more Logo names.
EDNS
Edits all Logo names.
EDPL name or list
Edits one or more Logo property lists.
EDPLIST name
Edits the properties of a lrpoerty list, a widget, or a panel.
EDPLS
Edits all Logo properties.
EDPS
Edits all user-defined, unburied procedures.
ERALL
Erases the entire Logo workspace.
ERASE ALL
ERASE procname
ERASE [procname1 procname2 procname3 …]
ERASE NAMES
ERASE PROCEDURES
ERASE PROPERTIES
(ER) Erases Logo elements.
ERN name or list
Erase one or more Logo names.
ERNS
Erases all Logo names.
ERPL name or list
Erases one or more Logo property lists.
ERPLS
Erases all Logo properties.
ERPS
Erases all procedures.
NAMELIST name-or-list
Outputs a structured contents list with names.
NAMES
Outputs a structured contents list with all names.
PLISTS
(PROPERTIES) Outputs a structured contents list with all properties.
PLLIST name
PLLIST list
Outputs a structured contents list with properties.
POALL
Prints the entire Logo workspace.
PON name
Prints a Logo name.
PONS
Prints all Logo names.
POPL name or list
Prints one or more Logo property lists.
POPLS
Prints all Logo properties.
POPS
Prints all Logo procedures.
POT name or list
Prints the title line of one or more user-defined procedures.
POTS
Prints the title line of all user-defined procedures.
PRIMITIVES
Outputs a structured contents list with all primitives.
PRINTOUT procname
(PRINTOUT procname1 procname2 …)
PRINTOUT contents-list
PRINTOUT ALL
PRINTOUT NAMES
PRINTOUT PROCEDURES
PRINTOUT PROPERTIES
PRINTOUT PRIMITIVES
(PO) Prints procedures, names, or properties.
PROCEDURES
Outputs a list with all user procedures.
PROCLIST name
PROCLIST list
Outputs a structured contents list with procedures.
UNBURY procedureName
UNBURY [procedureName, procedureName, …]
UNBURY contents-list
(UNBURY procedureName procedureName …)
Makes names and procedures visible.
UNBURYALL
Makes all names and procedures visible.
UNBURYNAME name or list
Makes one or more names visible.
UNBURYNAMES
Makes all names visible.
UNBURYPROC name or list
Makes one or more procedures visible.
UNBURYPROCS
Makes all procedures visible.
UNBURYPROP name or list
Makes one or more property lists visible.
UNBURYPROPS
Makes all property lists visible.

Putting things together

This section contains all commands that put together Logo words or lists, or access elements of Logo words or lists.

FPUT word word
FPUT word list
FPUT list list
Prepends an element to its input.
ISEQ from to
(ISEQ from to increment)
Outputs a list of sequential integers.
LIST object1 object2
(LIST object1 object2 object3 …)
Concatenates its inputs to a list.
LPUT word word
LPUT word list
LPUT list list
Appends an element to its input.
PARSE word
Parses a string and outputs a list.
RSEQ from to count
Outputs a list of equally spaced rational numbers.
SENTENCE object1 object2
(SENTENCE object1 object2 object3 …)
(SE) Concatenates its inputs to a list, flattening lists.
SUBST what with wordorlist
Substitutes text in a word or a list.
WORD object1 object2
(WORD object1 object2 object3 …)
Concatenates its inputs to a word.
XLIST object1 object2
(XLIST object1 object2 object3 …)
Concatenates its inputs to a parenthesized list.

Accessors

Access data.

BUTFIRST word
BUTFIRST list
(BF) Reports all but the first element of its input.
BUTLAST word
BUTLAST list
(BL) Reports all but the last element of its input.
BUTMEMBER word.or.list1 word.or.list2
(BM) Removes an element from its input.
FIRST word
FIRST list
Reports the first element of its input.
FLATTEN list
Reports a flat version of its list input.
FROMMEMBER word/list word/list
(FM) Removes the first part of its input until a pattern is found.
ITEM number word
ITEM number list
Returns a specific element of its input.
JOIN list separator
Converts a list to a word.
LAST word
LAST list
Reports the last element of its input.
LOWERCASE word
Converts its argument to lower case.
MIXEDCASE word
Converts its argument to mixed case.
PICK object
Randomly picks an element.
REMOVE thing wordOrList
Removes elements from a word or a list.
SPLIT word separator
Splits a word into a list using a separator.
UPPERCASE word
Converts its argument to upper case.

Queries

Test data or data contents.

COUNT word
COUNT list
Counts the number of items in its input.
DEFINED? name
(DEFINEDP) Checks whether a procedure is defined.
EMPTY? word
EMPTY? list
(EMPTYP) Checks whether a name is empty.
LIST? object
(LISTP) Checks for its input being a list.
MACRO? word
(MACROP) Checks its input for being a macro.
MEMBER? word-or-list word-or-list
(MEMBER? word-or-list word-or-list TRUE)
(MEMBERP) Checks if an object is part of another object.
NAME? name
(NAMEP) Checks whether its input is assigned a value.
NUMBER? object
(NUMBERP) Checks its input for being a number.
PLIST? word
(PLISTP) Checks its input for containing a property list.
PRIMITIVE? word
(PRIMITIVEP) Checks its input for being a built-in procedure or macro.
PROCEDURE? word
(PROCEDUREP) Checks its input for being a user-defined procedure.
WORD? object
(WORDP) Checks its input for being a word.

Arrays

Create and manipulate arrays.

An array is a creature from the early days of computing when everything was binary and the first counting number was zero so a three by three array (two dimensions) would be set up as

MAKE “A ARRAY [3 3]

which would sensibly numbered [1 1] through [3 3] but in fact the cells in the array are actually numbered as:

[0 0][0 1][0 2]
[1 0][1 1][1 2]
[2 0][2 1][2 2]

You would put “X” into the middle cell by ASET :A [1 1] “X (rather than the logical ASET :A [2 2] “X) which would result in…

[   ][   ][   ]
[   ][ X ][   ]
[   ][   ][   ]

Then someone would put “O” into the lower right cell by ASET :A [2 2] “O (rather than the equally logical ASET :A [3 3] “O) which would result in:

[   ][   ][   ]
[   ][ X ][   ]
[   ][   ][ O ]

…and so on. If an element has not been defined yet, it contains an empty list.

If you prefer to start array indexing from 1 on, you can change the "PREFS property ARRAYBASE to the value 1 (or any other value that you prefer as the lowest index). This settings also affects grids.

Access to elements of an array is much faster than access to elements of a list, because the location in the array can be pre-computed instead of having to walk through the list.

AGET array number
AGET array list
Reports the value of an array element.
ARRAY number
ARRAY list
ARRAY word
(ARRAY number list)
(ARRAY list list)
Creates an array.
ARRAY? object
(ARRAYP) Reports TRUE if the object is an array.
ARRAYDIMS array
Reports the structure of an array.
ASET array number value
ASET array list value
Sets the value of an array element.
FILLARRAY array list or word
Sets the values of an array.
LISTARRAY array
Reports the values of an array as a list.
SETARRAYDIMS array word
SETARRAYDIMS array list
Sets the structure of an array.
TEXTARRAY array
Sets the structure of an array.

Input and Output

Read and write data.

This section contains all commands that input or output data. The most used command is probably the PRINT command. Other commands work with files or directories.

Most commands use so-called streams internally. If a file is opened for reading or appending (see OPEN), Logo fetches the contents and makes the data available for subsequent reading. If you write to a file, the CLOSE command transfers the date to its storage location. Streams have channel numbers. Logo matches the Input and Output panels to channel #0.

The :STANDARD.INPUT and :STANDARD.OUTPUT variables contain the channel number that Logo uses for I/O. Usually, this is the channel number 0, which is the Input/Output channel. You can use the OPEN command to obtain a channel number to a file, and assign that channel number to above variables to make most I/O commands work with that file. Also, many I/O commands accept a channel number as an additional, optional input, so you can use I/O commands for multiple channels if you wish.

Note that all I/O commands always transfer Unicode characters, not single bytes. Depending on the channel's encoding, a Unicode character may consist of several bytes. Logo supports the extended Unicode character set with character code values of up to 1,114,111. Logo assumes UTF-8 encoding when reading or writing files.

ALERT message
(ALERT message button1)
(ALERT message button1 button2 …)
Displays an alert box.
CLOSE channel
(CLOSE)
Closes a stream.
CREATE filename
Creates a file.
CREATE.DIR foldername
(MKDIR) Creates a folder.
CURDIR
Reports the current working directory.
DELETE filename
Deletes a file or a folder.
DIRECTORY
(DIRECTORY pattern)
(DIR) Lists the contents of current working directory.
EDITFILE filename
(EDITFILE)
(EDF) Opens an editor to edit a file.
EOF?
(EOF? channel)
(EOFP) Outputs TRUE if the current stream is at EOF.
FILE? filename
(FILEP) Reports TRUE if a file or directory exists.
FORM number width precision
Formats a number.
HTML tagname text
Creates and outputs a HTML sequence.
KEY
Reports the code of the last key that the user typed.
OPEN filename
(OPEN filename mode)
OPEN [extensions-list]
(OPEN [extensions-list] mode)
Opens a file and returns the channel number.
PATHNAME filename
(PATHNAME filename TRUE)
Reports the full path name for a file name.
PRINT object
(PRINT)
(PRINT object1 object 2 …)
(PR) Prints text with a line feed.
PRINTLINE integerlist
(PRINTLINE integerlist channel)
Prints a list of numbers as Unicode characters.
PRINTQUOTE object
(PRINTQUOTE object channel)
(PQ) Prints its input and a newline.
PROGRESSBAR value
(PROGRESSBAR value message)
PROGRESSBAR -1
Displays a progress bar.
READ
(READ channel)
Reads one Logo word.
READCHAR
(READCHAR channel)
(RC) Read a character from the standard input stream.
READFILE pathname format
READFILE [extensions-list] format
Reads and parses the contents of a file.
READLINE
(READLINE channel)
Reads a line and outputs it as a list of numbers.
READLIST
(READLIST channel)
(RL) Reads a line and outputs it as a list.
READPROMPT text
(READPROMPT text preset)
(READPROMPT text preset TRUE/FALSE)
(READPROMPT)
(RP) Opens a dialog box and reads a line.
READQUOTE
(READQUOTE channel)
(RQ) Reads a line.
READWORD
(READWORD channel)
(RW) Reads the next word of a line.
RENAME oldname newname
Renames a disk file.
SELECT.FILE [extensions-list]
(SELECT.FILE [extensions-list] title)
SELECT.FILE []
(SELECT.FILE [] title)
SELECT.FILE extensions
(SELECT.FILE extensions title)
Displays a dialog to select a file.
SELECT.FOLDER
(SELECT.FOLDER prompt)
Displays a dialog to select a folder.
SETCURDIR directoryname
Changes the current working directory.
SETTEXTFONT name size attributes
(SETTEXTFONT name size)
(SETTEXTFONT name)
(SETTEXTFONT)
(SETTEXTFONT [name size attributes])
(SETTEXTFONT [name size])
(SETTEXTFONT [name])
(SETTEXTFONT [])
Sets the font for PRINT, TYPE and other output commands.
SHOW object
(SHOW)
(SHOW object1 object 2 …)
Prints text with a line feed.
SUBDIR
(SUBDIR pattern)
(SUBDIR path/pattern)
Lists the contents of current working directory.
TEXTFONT
Reports the font used for output.
TYPE object
(TYPE object1 object 2 …)
Prints text.
WEBLINK link
(WEBLINK link text)
Creates and outputs a HTML web link.
WRITEFILE pathname format wordorlist
WRITEFILE [extensions-list] format wordorlist
Stores a Logo word or list into a file.

Property lists

Add, retrieve, call, or remove properties.

Properties are values that are stored as property lists. These lists are not traditional values that MAKE and THING can handle. Instead, there are separate commands to create, to read, to set, to invoke, or to remove properties.

Many objects have built-in variables that belong to the object itself instead of the toplevel workspace. A turtle, for example, has a variable POSITION that sets or reports the turtle's position. A turtle can be ASKed to MAKE a new position, like in ASK 0 [MAKE “POSITION [100 100]]. Alternatively, these object specific variables may be accessed as properties of that object. Instead of ASKing a turtle like above, you can set the turtle's POSITION property as in PPROP 0 “POSITION [100 100].

CPROP name propertyname
(CPROP name propertyname input-1 …)
Calls a property as a procedure.
GLIST property
Reports the property lists that contain a property with a given name.
GPROP name propertyname
Retrieves a property.
PLIST name
Reports the property list of a name.
PPROP name propertyname object
Stores a property.
PPROPS name list
Stores a list of properties.
REMPROP name propertyname
Removes a property.

Multimedia Commands

Multimedia commands.

MIDI.RECORD TRUE
MIDI.RECORD filename
Records and saves music commands that PLAY plays.
PLAY filenameOrList
(PLAY filenameOrList TRUE)
(PLAY filenameOrList loop wait)
(PLAY)
Plays sound files or notes.
PLAY.NOTES notes
Plays simple songs on a robot's speaker.
PLAY.SOUND number
Play a predefined sound on a robot's speaker.
SAY word or list
Makes Logo speak its input.
SELECT.VOICE
Opens a dialog where you can select a voice for the SAY command.

Program Flow

Control the program flow.

This section describes various commands to control the program flow. The IF command implements branching, and various loop commands implement looping. CATCH and THROW implement a mechanism to pass control across procedure boundaries.

.DEFMACRO name instructionlist
Defines a macro.
.MACRO procname
.MACRO procname :input …
.MACRO procname … [:optional-input value] … argcount
.MACRO procname … [:list-input] argcount
Defines a macro.
.MAYBEOUTPUT value
Exits a procedure and outputs a value if present.
APPLY procedure list
Applies a parameter list to a procedure.
CASE expression [ [value [case-value]] … [ELSE else-value]]
Outputs a value based on an input value.
CATCH word instructions
CATCH TRUE instructions
CATCH “ERROR instructions
Catches runtime errors and THROWn data.
COPYDEF newname currentname
Copies a procedure definition.
DEFINE name instructionlist
Defines a procedure.
DO.UNTIL runlist testlist
Runs a list until a condition is true.
DO.WHILE runlist testlist
Runs a list until a condition is false.
IF expression THEN instructions ELSE instructions
Starts the ELSE branch of an IF command.
END
Ends a procedure definition.
ERROR
Outputs the last runtime error.
EVAL list
Runs a list and collects all outputs.
FOR variable-name start-value end-value [runlist]
(FOR variable-name start-value end-value [runlist] increment-value)
FOR [variable-name start-value end-value] [runlist]
FOR [variable-name start-value end-value increment-value] [runlist]
Runs a list for a defined number of times.
FOREACH word-or-list runlist
Runs a list for each element of its first input.
FOREVER runlist
Runs a list forever.
GO name
Jumps to a label inside a procedure.
HALT id
(HALT)
Stops one or all background programs.
IF expression [then-instructions]
IF expression [then-instructions] [else-instructions]
IF expression then-instructions
(IF expression then-value)
(IF expression then-value else-value)
IF expression THEN instructions
IF expression THEN instructions ELSE instructions
Runs instructions based on a condition.
IFFALSE instruction-list
(IFF) Runs a list if TEST was false.
IFTRUE instruction-list
(IFT) Runs a list if TEST was true.
IGNORE object
Ignores the output of a procedure.
LABEL object
Marks a target for the GO command.
LAUNCH runlist
LAUNCH “procedurename
(LAUNCH “procedurename input1 …)
Launches a runlist or procedure for execution in the background.
LOCAL name
(LOCAL name1 name2 …)
Declares local variables inside a procedure.
MACROEXPAND [name inputs]
Outputs the expansion of a macro.
OUTPUT value
(OP) Exits a procedure and outputs a value.
REPCOUNT
Reports the value of the REPEAT counter.
REPEAT number list
Runs a runlist repeatedly.
REPTOTAL
Reports the total number of REPEATs.
RUN word-or-list
Runs a word or list.
STOP
Exits a procedure, or stops a program.
TEST expression
Test a condition; used with IFTRUE and IFFALSE.
TEXT procedurename
Outputs a procedure definition.
IF expression THEN instructions
IF expression THEN instructions ELSE instructions
Starts the THEN branch of an IF command.
THROW word
(THROW word message)
(THROW)
Throws a Logo word or a runtime error.
TO procname
TO procname :input …
TO procname … [:optional-input value] … argcount
TO procname … [:list-input] argcount
Defines a procedure.
TOPLEVEL
Returns to toplevel.
UNTIL testlist runlist
Runs a list until a condition is true.
WAIT number
Waits for a number of milliseconds.
WHILE testlist runlist
Runs a list until a condition is false.

Math

Arithmetic computations.

Logo understands quite a lot of math commands, from simple addition and subtraction up to functions like the cosecant, or the square root. Random numbers are part of the math functions as well.

dividend % divisor
% dividend divisor
(REMAINDER) Outputs the remainder of two numbers.
number * number
* number number
(* number number number)
(PRODUCT) Calculates the product of its inputs.
number1 + number2
+ number1 number2
(+ number1 number2 number3 …)
(SUM) Reports the sum of its inputs.
number1 - number2
- number1 number2
(- number1 number2 number3 …)
(DIFFERENCE) Outputs the difference of two or more numbers.
number / number
/ number number
(/ number number number …)
(QUOTIENT) Reports the quotient of its inputs.
number < number
< number number
(.LT, LESS?, LESSP) Tests if its first input is less than its second input.
number <= number
<= number number
(.LE, LESSEQUAL?, LESSEQUALP) Tests if its first input is less than or equal to its second input.
object <> object
object <> object
<> object object
(!=, .NE, NOT.EQUAL?, NOT.EQUALP, NOTEQUAL?, NOTEQUALP) Tests its inputs for inequality.
object = object
= object object
(.EQ, EQUAL?, EQUALP) Tests its inputs for equality.
number > number
> number number
(GREATER?, GREATERP, .GT) Tests if its first input is greater than its second input.
number >= number
>= number number
(.GE, GREATEREQUAL?, GREATEREQUALP) Tests if its first input is greater than or equal to its second input.
ABS number
Reports the absolute value of a number.
AND input1 input2
(AND input1 input2 input3 …)
Logical AND.
ARCCOS number
(ACOS) Reports the arccosine.
ARCCOT number
(ACOT) Reports the arccotangent.
ARCCSC number
(ACSC) Reports the arccosecant.
ARCSEC number
(ASEC) Reports the arcsecant.
ARCSIN number
(ASIN) Reports the arcsine.
ARCTAN number
(ATAN) Reports the arctangent.
ARCTAN2 deltaX deltaY
(ATAN2) Reports the polar angle heading of the motion vector (position change) deltaX deltaY.
COS number
Reports the cosine.
COT number
Reports the cotangent.
CSC number
Reports the cosecant.
EXPN number
(EXP) Calculates the natural base e raised to a power.
INT number
Reports the integer part of a number.
LOG number
(LN) Outputs the natural logarithm of its input.
LOG10 number
Outputs the logarithm of its input.
LOGAND integer1 integer2
Combines its inputs with a boolean AND operation.
LOGNOT integer
Reports the bitwise logical complement of its input.
LOGOR integer1 integer2
Combines its inputs with a boolean OR operation.
LOGXOR integer1 integer2
Combines its inputs with a boolean XOR operation.
LSH integer integer
(ASHIFT) Shifts its input with sign extension.
LSHIFT integer integer
Shifts its input without sign extension.
MINUS number
Outputs the negative value of its input.
MODULO dividend divisor
Outputs the remainder of two numbers.
NOT expression
Negates its input.
OR object1 object2
(OR object1 object2 object3 …)
Performs a logical OR on its input.
PI
Reports the number Pi.
RADARCTAN number
(RADATAN) Reports the arc tangent of an angle expressed in radians.
RADCOS number
Reports the cosine of an angle expressed in radians.
RADSIN number
Reports the sine of an angle expressed in radians.
RANDOM number
(RANDOM bottom top)
Outputs a random number.
RERANDOM number
(RERANDOM)
Seed the random number generator.
ROUND number
Rounds a number.
SEC number
Reports the secant.
SIN number
Reports the sine.
SQRT number
Reports the square root.
TAN number
Reports the tangent.
number ^ number
^ number number
(^ number number number …)
(POWER) Raises a number to the power of another number.

This section explains the command that you can use to modify the menu of Terrapin Logo. Please note that menu handling has changed. The menu ID is not numeric anymore; it can also be a word (and it is actually for the built-in commands).

Also, referring to menus is now strictly by ID than by name. In Logo 4, you used the menu label to reference the menu, which is unfortunate if you want to translate a menu.

The Logo 4 commands ONCOMMAND and APPENDMENUCOMMAND commands are gone.

An example:

APPENDMENU "|Test| "TEST
APPENDMENUITEM "TEST "|My Test Item| "TESTITEM
WHEN [MENU TESTDATA] [PR [I HAVE BEEN CLICKED]]

Note that Logo only checks commands that you have defined with the APPENDMENUITEM command. It does not check menu commands of built-in menu items such as File/Load or others.

APPENDMENU menuname id
Appends a new menu.
APPENDMENUITEM menu-id itemname item-id
Appends a new menu item.
COMMAND id
Invoke a menu command by its ID.
DELETEMENU id
Deletes a menu.
DELETEMENUITEM id
Deletes a menu item.
FINDMENUID label
Finds the ID of a menu item.

Debugging

Track program execution.

Debugging commands are essential to find programming errors. They help with inspecting programs and data, to pause a program, to find out why a program takes too much time, and much more. Logo can pause because of several reasons:

  • The PAUSE command has been executed
  • A runtime error has occured
  • The PAUSE button has been clicked
  • A STEPPED element has triggered a pause
BACKTRACE
(BT) Prints the list of nested procedure calls.
BPCLEAR
Deletes all breakpoints.
CONTINUE
(CO) Ends a pause.
PAUSE
Pauses a procedure.
STEP procedurename
STEP [procedurename1 …]
STEP contents-list
Turns on stepping for the given elements.
STEPPED
Outputs a structured contents list of all stepped elements.
STEPPED? name or list
(STEPPEDP) Outputs TRUE if the element described by its input is stepped.
TRACE procedurename
TRACE [procedurename1 …]
TRACE contents-list
Turns on tracing of the given elements.
TRACED
Outputs a structured contents list of all traced elements.
TRACED? name or list
(TRACEDP) Outputs TRUE if the element described by its input is traced.
UNSTEP procedurename
UNSTEP [procedurename1 …]
UNSTEP contents-list
Turns off stepping of the given elements.
UNTRACE procedurename
UNTRACE [procedurename1 …]
UNTRACE contents-list
Turns off tracing of the given elements.

Creating Turtles

Create and assign turtles.

These commands handle the number of turtles, how they are created, and how to talk to them.

ALLTURTLES
A list of all turtles.
CTURTLES number
Arranges turtles in a circle.
LTURTLES number
Arranges turtles in a row.
SETTURTLENAME :turtle :name
(SETTNAME) Sets the name of a turtle.
SETTURTLES number
SETTURTLES number
(SETT) Creates a range of turtles.
TURTLENAME
(TNAME) Gets the name of the first active turtle.
TURTLENAMES
(TNAMES) Outputs a list of all turtle names.
TURTLES
Reports the number of turtles.

Turtle Drawing

Move turtles around, and make them draw.

Turtle movement commands control the direction of the turtle movement. Drawing commands draw arcs, text, or fill areas.

All commands that accept a coordinate pair accept one of the following inputs:

  • No inputs: use the turtle's coordinates.
  • One input: if the input is a number, use that number for both the X and Y coordinates; if it is a list, it is a two-element list with the X and Y coordinates.
  • Two inputs: use the two numbers as X and Y coordinates.

Examples:

; draw a dot at the current coordinates
(DOT)
; draw a dot at 100, 100
DOT 100
; draw a dot at 50, 90
DOT [50 90]
; draw a dot at 111,222
(DOT 111 222)

Note that the background color or image is not part of a drawing, and its color cannot be examined.

Please also not that most commands are also valid for controls as well; controls act exactly like turtles, they just cannot draw because they do not have a pen. Therefore, we often use the word “widget”, which addresses turtles as well as controls.

ARC degrees radius
(ARC degrees radius TRUE)
Draws an arc.
BACK number
(BK) Moves a turtle backwards.
DISTANCE [x y]
Reports the distance between the turtle and a location.
DOT [xcoordinate ycoordinate]
(DOT)
Draws a dot.
DOT?
(DOT? [xcoordinate ycoordinate])
(DOTP) Tests whether a pixel is present at the given location.
DOTCOLOR [xcoordinate ycoordinate]
(DOTCOLOR)
Reports the color of a pixel.
FILL
(FILL tolerance)
Fills an area.
FONT
Reports the current font of the first active turtle.
FONTS
Reports a list of available fonts.
FORWARD number
(FD) Moves a turtle forward.
GETX
(XCOR) Reports the X coordinate of a turtle.
GETXY
(POS) Reports the coordinates of a turtle.
GETY
(YCOR) Reports the Y coordinate of a turtle.
HEADING
Reports the heading of a turtle.
HIDETURTLE
(HT) Hides a turtle.
HOME
Moves the turtle back to [0 0].
LEFT number
(LT) Turns a turtle left.
OPACITY
Reports the opacity of the first active turtle.
ORIGIN
Reports the origin of a turtle's coordinate system.
PANGLE
Reports the turtle's angle as a polar angle.
PDIST
Reports the distance from the turtle to its home.
PEN
Reports the pen mode.
PENDOWN
(PD) Puts the pen down.
PENDOWN?
(PENDOWNP) Checks whether the pen is down.
PENERASE
(PE) The pen draws with the background color.
PENREVERSE
(PX) The pen inverts all colors.
PENUP
(PU) The pen moves up.
PHEADING
Reports the turtle's polar heading.
PPOS
Reports the turtle's polar position.
PSETHEADING number
PSETHEADING number
(PSETH) Sets the polar heading of a turtle.
RIGHT number
(RT) Turns a turtle right.
SETFONT name size attributes
(SETFONT name size)
(SETFONT name)
(SETFONT)
(SETFONT [name size attributes])
(SETFONT [name size])
(SETFONT [name])
(SETFONT [])
Sets the turtle drawing font.
SETHEADING number
(SETH) Sets the heading of a turtle.
SETOPACITY value
Sets the opacity of all active turtles.
SETORIGIN xy
SETORIGIN [x y]
(SETORIGIN)
Sets the coordinate system origin of the active turtles.
SETP distance angle
Sets the turtle's polar position.
SETPEN [penstate pencolor]
Sets the pen characteristics.
SETSHADOW value
Sets the drop shadow for all active turtles.
SETSPEED number
Sets the speed in which turtle commands are executed.
SETSTEPSIZE pixels
Sets the step size of all active turtles and bitmaps.
SETTURTLESIZE number
SETTURTLESIZE list
(SETTURTLESIZE x-scale y-scale)
(SETTSIZE, SETTS) Sets the scaling factor of a widget.
SETWIDTH number
(SETW) Sets the pen width.
SETX x-coordinate
Sets the X coordinate of a turtle.
SETXY [x-coordinate y-coordinate]
(SETXY x-coordinate y-coordinate)
(SETPOS) Sets the coordinates of a turtle.
SETY y-coordinate
Sets the Y coordinate of a turtle.
SHADOW
Reports the drop shadow for the first active turtle.
SHOWN?
(SHOWNP) Reports whether a turtle is visible.
SHOWTURTLE
(ST) Makes a turtle visible.
SLOWTURTLE
Slows down the turtle to half speed.
SPEED
Reports the speed in which turtle commands are executed.
STAMPOVAL xradius yradius
(STAMPOVAL xradius yradius “TRUE)
Draws an oval.
STAMPRECT width height
(STAMPRECT width height “TRUE)
Draws a rectangle.
STEPSIZE
Outputs the step size of the first active turtle or bitmap.
TOWARDS [xcoordinate ycoordinate]
Reports the angle of a position compared to the turtle position.
TURTLESIZE
(TSIZE) Reports the scaling factor of a turtle.
TURTLETEXT whatToPrint
(TT) Prints its input on the Graphics canvas.
WIDTH
Reports the pen width.

Turtle Shapes

The commands in this group load, change, and lock turtle images. A turtle shape is an image file that can be loaded from the cloud storage.

LOADSHAPE filename
LOADSHAPE filename.ext
LOADSHAPE [extensions-list]
(LOADSHAPE)
Loads a turtle shape from a data space and sets the shape of all active turtles.
LOADSNAP filename
LOADSNAP [extensions-list]
(LOADSNAP)
Loads a bitmap.
LOCKSHAPE
Prevents a bitmap from turning.
SAVESHAPE filename
SAVESHAPE [extensions-list]
(SAVESHAPE)
Saves the shape of the first active turtle.
SAVESNAP turtle filename
SAVESNAP turtle filename.ext
SAVESNAP [extensions-list]
(SAVESNAP)
Saves a turtle shape.
SETSHAPE name-of-shape
(SETSHAPE)
Sets the shape of all active turtles.
SHAPE
Outputs the name of the first active turtle's shape.
SNAP width height
Moves parts of the Graphics panel into a bitmap.
SNAPSIZE turtle
Outputs the size of a bitmap.
STAMP
(STAMP bitmap)
(STAMP bitmap width height)
Draws a bitmap or turtle.
UNLOCKSHAPE
Lets a bitmap rotate according to the turtle's heading.

Colors

The color commands assign colors to the background of the Graphics canvas, or the turtle pen. A color is one of three things: A number between 0 and 137 for the 138 Web colors, a color name (which is one of 138 standard Web color names, see COLORS), or a list of four values, one each for Red, Green, and Blue. These three values may vary from 0 to 255.

The fourth value is optional and describes how transparent a color should be. A value of 0 makes the color invisible, and a value of 1 makes it opaque. This value is also referred to as a color's alpha value.

Color indexes and color names do not have an own alpha value. Instead, their alpha value is set to 1 (fully opaque), unless you use a turtle command. In that case, the turtle's alpha value (which you set with the SETALPHA command) is returned as the alpha value of a color name or color index. If you use a color name to work with the background, a value of 1 (fully opaque) is used. The same happens if you supply a list of three color values without an alpha value; for commands related to a turtle, the turtle's alpha value is used; for all other purposes, an alpha value of 1 is used. See the SETALPHA command for a few examples.

Logo color names are the same as the standard Web color names. These color names go back a long way to the first graphic subsystems based on the X11 architecture in 1986. Nowadays, every Web browser understands these color names.

The tables below display the color names along with their color index and the RGB values, which are the intensities of the Red, Green and Blue components of a color, expressed as values between 0 and 255.

The following commands would all set the pen color to Gold:

SETPC "GOLD
SETPC 60
SETPC [255 215 0]
SETPC [255 215 0 1]

If you want to use a transparent gold, you can use a four-element list as in this example, with the alpha value set to 0.5:

SETPC [255 215 0 0.5]
Name Index RGB values
Pink colors
Pink 112 255 192 203
LightPink 77 255 182 193
HotPink 63 255 105 180
DeepPink 50 255 20 147
PaleVioletRed 108 219 112 147
MediumVioletRed 94 199 21 133
Red colors
LightSalmon 78 255 160 122
Salmon 118 250 128 114
DarkSalmon 44 233 150 122
LightCoral 73 240 128 128
IndianRed 64 205 92 92
Crimson 32 220 20 60
FireBrick 54 178 34 34
DarkRed 43 139 0 0
Red 12 255 0 0
OrangeRed 103 255 69 0
Tomato 132 255 99 71
Coral 29 255 127 80
DarkOrange 41 255 140 0
Orange 102 255 165 0
Yellow colors
Yellow 14 255 255 0
LightYellow 83 255 255 224
LemonChiffon 71 255 250 205
LightGoldenrodYellow 75 250 250 210
PapayaWhip 109 255 239 213
Moccasin 98 255 228 181
PeachPuff 110 255 218 185
PaleGoldenrod 105 238 232 170
Khaki 67 240 230 140
DarkKhaki 38 189 183 107
Gold 59 255 215 0
Brown colors
Cornsilk 31 255 248 220
BlanchedAlmond 22 255 235 205
Bisque 21 255 228 196
NavajoWhite 99 255 222 173
Wheat 135 245 222 179
BurlyWood 25 222 184 135
Tan 130 210 180 140
RosyBrown 115 188 143 143
SandyBrown 119 244 164 96
Goldenrod 60 218 165 32
DarkGoldenrod 35 184 134 11
Peru 111 205 133 63
Chocolate 28 210 105 30
SaddleBrown 117 139 69 19
Sienna 122 160 82 45
Brown 24 165 42 42
Maroon 4 128 0 0
Color name Index RGB values
Green colors
DarkOliveGreen 40 85 107 47
Olive 6 128 128 0
OliveDrab 101 107 142 35
YellowGreen 137 154 205 50
LimeGreen 84 50 205 50
Lime 10 0 255 0
LawnGreen 70 124 252 0
Chartreuse 27 127 255 0
GreenYellow 61 173 255 47
SpringGreen 128 0 255 127
MediumSpringGreen 92 0 250 154
LightGreen 76 144 238 144
PaleGreen 106 152 251 152
DarkSeaGreen 45 143 188 143
MediumSeaGreen 90 60 179 113
SeaGreen 120 46 139 87
ForestGreen 56 34 139 34
Green 2 0 128 0
DarkGreen 37 0 100 0
Cyan colors
MediumAquamarine 86 102 205 170
Cyan (Aqua) 11 0 255 255
LightCyan 74 224 255 255
PaleTurquoise 107 175 238 238
Aquamarine 18 127 255 212
Turquoise 133 64 224 208
MediumTurquoise 93 72 209 204
DarkTurquoise 48 0 206 209
LightSeaGreen 79 32 178 170
CadetBlue 26 95 158 160
DarkCyan 34 0 139 139
Teal 3 0 128 128
Blue colors
LightSteelBlue 82 176 196 222
PowderBlue 114 176 224 230
LightBlue 72 173 216 230
SkyBlue 124 135 206 235
LightSkyBlue 80 135 206 250
DeepSkyBlue 51 0 191 255
DodgerBlue 53 30 144 255
CornflowerBlue 30 100 149 237
SteelBlue 129 70 130 180
RoyalBlue 116 65 105 225
Blue 9 0 0 255
MediumBlue 87 0 0 205
DarkBlue 33 0 0 139
Navy 1 0 0 128
MidnightBlue 95 25 25 112
Color name Index RGB values
Purple colors
Lavender 68 230 230 250
Thistle 131 216 191 216
Plum 113 221 160 221
Violet 134 238 130 238
Orchid 104 218 112 214
Magenta (Fuchsia) 13 255 0 255
MediumOrchid 88 186 85 211
MediumPurple 89 147 112 219
BlueViolet 23 138 43 226
DarkViolet 49 148 0 211
DarkOrchid 42 153 50 204
DarkMagenta 39 139 0 139
Purple 5 128 0 128
Indigo 65 75 0 130
DarkSlateBlue 46 72 61 139
SlateBlue 125 106 90 205
MediumSlateBlue 91 123 104 238
White colors
White 15 255 255 255
Snow 127 255 250 250
Honeydew 62 240 255 240
MintCream 96 245 255 250
Azure 19 240 255 255
AliceBlue 16 240 248 255
GhostWhite 58 248 248 255
WhiteSmoke 136 245 245 245
Seashell 121 255 245 238
Beige 20 245 245 220
OldLace 100 253 245 230
FloralWhite 55 255 250 240
Ivory 66 255 255 240
AntiqueWhite 17 250 235 215
Linen 85 250 240 230
LavenderBlush 69 255 240 245
MistyRose 97 255 228 225
Gray/Black colors
Gainsboro 57 220 220 220
LightGray 7 211 211 211
Silver 123 192 192 192
DarkGray 36 169 169 169
Gray 8 128 128 128
DimGray 52 105 105 105
LightSlateGray 81 119 136 153
SlateGray 126 112 128 144
DarkSlateGray 47 47 79 79
Black 0 0 0 0
ALPHA
Reports the first active turtle's alpha value.
BACKGROUND
(BG) Reports the background color.
BGPATTERN
Reports the background pattern.
COLOR “color-name
COLOR color-index
Reports the RGB color value for a color name or color index.
COLOR “color-name
COLOR color-index
Reports the RGB color value for a color name or color index.
COLORINDEX “color-name
COLORINDEX [red green blue]
(BASECOLOR) Coerces a color value to a basic Logo color number.
COLORNAME color-value
COLORNAME [red green blue]
Reports the name of a color if possible.
COLORS
Reports a list of available color names.
PATTERN
Reports the turtle's pattern.
PENCOLOR
(PC) Reports the pen color.
SETALPHA alphavalue
Sets the default alpha value for colors.
SETBG color-index
SETBG “color-name
SETBG [red green blue alpha]
Sets the background color.
SETBGPATTERN number
SETBGPATTERN list
SETBGPATTERN bitmap-name
Sets the background pattern.
SETPATTERN number
SETPATTERN list
SETPATTERN turtle
Sets the turtle pattern.
SETPC color-value
SETPC “color-name
SETPC [red green blue alpha]
Sets the pen color.
SETTEXTCOLOR foreground background
(SETTEXTCOLOR foreground)
Sets the text color in the Output panel.

The Graphics canvas

The Graphics canvas is the drawing surface for the turtles. It is 2000 by 2000 pixels wide, but Logo only displays a small portion of it through its Graphics panel. The Graphics panel is the viewport, whose size varies depending on the size of the browser canvas or the position of the slider that separates the Graphics panel from the Output panel. The SETBOUNDS command can be used to set the size of the viewport to a fixed value.

BOUNCE
Lets the turtles bounce off the graphics bounds inside the Graphics canvas.
BOUNDS
Reports the d rawing bounds of the Graphics canvas.
BUTTON?
(BUTTONP) Reports the state of the left mouse button.
CLEAN
Erases the graphics canvas.
CLEARSCREEN
(CS) Erases the graphics pane and homes the turtle.
DRAW
Clears the current graphics canvas and resets all attached turtles.
FENCE
Fences all turtles inside the drawing bounds.
GRID size
GRID [x-size x-size]
(GRID size display-units)
(GRID size [x-display-units y-display-units])
(GRID size FALSE)
Sets the characteristics of the graphics grid.
GRIDOFF
Hides the grid of the Graphics window.
GRIDON
(GRIDON size)
(GRIDON [horizontal-size vertical-size])
Displays the grid of the Graphics window.
LOADPIC filename.ext
(LOADPIC filename.ext TRUE)
LOADPIC [extensions-list]
(LOADPIC [extensions-list] TRUE)
(LOADPIC)
Loads a picture as background picture.
MOUSE
Reports the position of the mouse cursor.
MOUSESHAPE
Reports the shape of the mouse cursor.
SAVEPIC filename.ext
SAVEPIC [extensions-list]
(SAVEPIC)
Saves the contents of the Graphics window.
SETBOUNDS size
SETBOUNDS [x y]
(SETBOUNDS)
Set the drawing bounds of the current Graphics canvas.
SETMOUSESHAPE number
(SETMOUSESHAPE)
Sets the shape of the mouse cursor.
WINDOW
Removes the boundary for turtle movements.
WRAP
Lets the turtles wrap inside the canvas.

Objects

Create and manipulate objects.

Object commands create and destroy objects like turtles, or the objects defined in additional extensions to Terrapin Logo Pro. The built-in TELL list is often used to talk to a specific set of objects. For a description of commands around TELL, see the turtle commands. See also TELLALL, TELLODD, TELLEVEN, EACH, and WHO.

Once created, objects live forever unless you erase them with the ERASE command.

.WHO
Reports a list of objects listening to commands.
ASK word runlist
ASK number runlist
ASK list runlist
Makes objects execute a list of commands.
CHECKTYPE value type
Checks an value for a type.
DECLARE kind name
(DCL) Creates an object.
EACH runlist
Applies a runlist to every object in the TELL list.
EVERY name
Outputs a list of objects.
IS.A object type
Checks an object for being of a specific type.
NEW kind
Creates a new Logo object.
TELL number
TELL object
TELL list
Defines a list of objects listening to commands.
TELLALL first last
Tells a range of turtle numbers.
TELLEVEN
Tells all turtles with even numbers.
TELLODD
Tells all turtles with odd numbers.
TYPEOF name
Reports the type of a name.
WHO
Reports a list of objects listening to commands.

Grids

A Logo grid is a special control that lets you arrange widgets in a grid. This makes a grid a very powerful feature, because it is not necessary to re-align controls because of changes to the display size when you store them in a grid. Note that a grid cell can only take a single widget.

A grid is a GRID widget, which you create either be dragging the grid symbol from the Toolbox' “Controls” panel to the Graphics panel, or with the help of the NEW or DECLARE commands. Once you have created a grid, you can access its individual cells with the commands described below. Initially, each grid cell contains a STATICTEXT widget whose text you can set via its TEXT property.

By default, a GRID widget has a size of 3×3 cells. You can change the number of rows by setting the grid's ROWS property, and you can set the value of its COLUMNS property to set the number of columns. You can also use the SETGRIDDIMS command to change the dimensions of the grid. Changing the grid's dimensions erases the contents of the grid, and destroys any widgets that have been stored into the grid. A grid adjusts itself to the largest items of a row or column. You can use the FILLGRID command to quickly fill a grid with text content.

A grid cell has “coordinates” that range from 0 to the number of rows or columns minus one. Thus, the top left cell has the coordinates 0, 0, the next cell to the right has 1, 0, and so on. This has been modeled after Logo arrays, who have a similar way to access array elements; see the page about arrays for a detailed description of array coordinates.

Initially, a grid has cell borders; you can change the color of the borders by setting the grid's BORDER property to a different color, or you can make it invisible by using a color with an alpha value of 0, like, for example, [0 0 0 0].

You can change the properties of the entire grid, or a row or column with the GPPROP command, which makes it easy to apply styles to, for example, a header row. Also, you can define a runlist for each grid cell that Logo executes when the cell has been clicked by setting the cell widget's RUN property.

For more information, see the Grids chapter of the Logo manual.

FILLGRID grid-name wordorlist
Sets the text values of a grid.
GGET grid-name row column
Outputs the name of a widget stored in a grid cell.
GGETTEXT grid-name row column
Outputs the text of a grid cell.
GPPROP grid-name property-name property-value
(GPPROP grid-name property-name property-value column)
(GPPROP grid-name property-name property-value column row)
Alters a property of a grid, a row, a column, or a cell.
GRIDDIMS grid-name
Reports the size of a grid.
GSET grid-name row column widget-name
Stores a widget into a grid cell.
GSETTEXT grid-name row column text
Stores a text into a grid cell.
LISTGRID grid
Reports the values of a grid as a list.
SETGRIDDIMS grid-name rows columns
Sets the size of a grid.

Robot Commands

All Bluetooth robots must be connected to Logo with the Bluetooth selection dialog available at the “Tools/Connect to Bluetooth Device” menu item or the SELECT.BLUETOOTH command.

Pro-Bot needs a serial-to-USB connection that the Web based version of Logo cannot offer. To use Pro-Bot, you need to use the desktop version of Terrapin Logo.

Please note that robot commands are only available in the licensed version of Logo.

BLUEBOT.BATTERY
Reports Blue-Bot's battery level.
BLUEBOT.CLEAR
Clears all commands stored in Blue-Bot's memory.
BLUEBOT.CLOSE
Disconnects the Blue-Bot from Logo.
BLUEBOT.GO
Executes commands stored in Blue-Bot's memory.
BLUEBOT.RUN procedurename
BLUEBOT.RUN [list of commands]
Executes Blue-Bot commands.
BLUEBOT.WRITE procedure-name
BLUEBOT.WRITE [runlist]
Downloads a procedure to Blue-Bot.
BLUEBOT?
(BLUEBOTP, BLUEBOT.OPEN) Tests if the Blue-Bot is connected and ready to receive commands.
LED word-or-list color
(LED word-or-list color duration)
Controls a robot's LEDs.
MOTORS speed
Controls a robot's motors.
PROBOT.CLOSE
Disconnects the Pro-Bot from Logo.
PROBOT.LIGHTS TRUE or FALSE
Turns the Pro-Bot's headlights on or off.
PROBOT.READ
Uploads all Pro-Bot procedures into Logo's workspace.
PROBOT.SOUND 1 through 7
Plays Pro-Bot sounds.
PROBOT.WRITE
(PROBOT.WRITE units)
Downloads all Pro-Bot procedures to the Pro-Bot.
PROBOT?
(PROBOTP, PROBOT.OPEN) Tests if a Pro-Bot is connected and ready to receive commands.

For backwards compatibility, PROBOT.OPEN is synonymous to PROBOT?.

ROOTBOT.CLOSE
Disconnects a Root robot.
ROOTBOT?
(ROOTBOTP) Tests if a Root robot is connected and ready to receive commands.
SELECT.BLUETOOTH
Selects a Bluetooth device.

Properties

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.

APPNAME
Contains the name of your Logo app.
ARRAYBASE
Controls the lowest array or grid index.
AUTOSAVE
Controls the amount of data that Logo saves and restores automatically.
BROWSER
Reports the browser name.
CASE
Controls the conversion of input to upper case.
COLORED.TURTLES
Displays turtles with their pen color.
CONTROLS.FONT
Controls the font used when creating a control.
DEBUGGER
Controls the use of the Logo debugger.
ENVIRONMENT
Reports the device that Logo is executing upon.
FULLSCREEN
Controls whether to have Terrapin Logo occupy the entire screen or display in normal size.
LISTENER.LINES
Controls the maximum number of lines in the Listener panel.
LISTENER.READONLY
Controls whether all output in the Listener panel is readonly.
LOCALE
Alters Logo's language.
PICTURE.FORMAT
Controls the file extension used for images if none was supplied.
PRECISION
Controls the number of decimals that Logo prints.
RELAXED.SYNTAX
Relaxes the syntax requirements of Logo.
SCREENSIZE
Reports the size of the browser window (Web) or the desktop (Desktop version).
STACKSIZE
Controls the maximum number of nested procedure calls.
TAB
Controls the tab stop size used in the Listener's output field.
TURTLE.FONT
Controls the font used when creating a control.
USERNAME
Reports the user's name.
VERSION
Reports the Logo version number.

Widget (WIDGET)

All objects that can be moved around on the Graphics panel (widgets) have a common set of properties. You cannot create a WIDGET object, only objects that are also widgets.

A widget can move, it can be hidden or shown, enabled or disabled, and the size can be changed. Widgets include turtles, controls, and bitmaps.

If the command IS.A object “WIDGET outputs TRUE, the object has the properties listed below. If you for example, ask a BUTTON widget if it is a button or a widget, it would always respond with TRUE:

DECLARE "BUTTON "OK
IS.A "OK "BUTTON
Result: TRUE
IS.A "OK "WIDGET
Result: TRUE

This makes it easier to use the correct properties with a widget. A turtle, for example, does not have a TEXT property like a button has, but both share the POSITION property. This way, a Logo program can easily check if a property is OK to use with the help of the IS.A command.

ALIGN
Controls the alignment of a widget in a grid cell.
ANCHOR
Controls the anchoring of a widget.
AUTOWIDTH
Controls the auto-resizing of a widget in a grid cell.
BORDER
Sets or reports the widget's border color.
BOUNDS
Reports the widget's size, depending on the scale and rotation.
COLUMN
Sets or reports the widget's column number if in a grid cell.
CRAWL
Sets or reports the widget's crawl speed.
ENABLED
Enables or disables a widget.
FONT
Sets or reports the widget's font.
GLOW
Determines whether the widget's drop shadow appears as a glow effect.
HEADING
Controls the widget's heading.
NAME
Sets or reports the object's alias name.
OPACITY
Controls the opacity value used for colors.
ORIGIN
Controls the origin of the widget's coordinate system.
ORIGINALNAME
Reports the widget's original name.
POSITION
Sets or reports the widget's position.
ROW
Sets or reports the widget's row number in a grid.
RUN
Stores a runlist that Logo executes when the widget is clicked.
SCALE
Controls the widget's scaling.
SHADOW
Controls the widget's drop shadow.
SHAPELOCK
Locks or unlocks a widget's rotation.
SIZE
Reports or sets the size of the widget's bounding box.
STARTANGLE
Contains the starting angle of a widget if dropped.
STEPSIZE
Controls the number of pixels per step that the widget moves forward or backwards.
TOOLTIP
Controls the contents of the widget's tool tip.
VISIBLE
Hides or shows the widget.
Z.ORDER
Controls the sequence of widgets when displayed.

Bitmaps (BITMAP)

A BITMAP object is a widget that is almost a turtle; it cannot draw, however. For a list of widget properties, see the Widget page.

ASK bitmap-name [LOAD filename]
Loads an image file into the bitmap.
ASK bitmap-name [SAVE filename]
Saves the bitmap into an image file.
ASK bitmap-name [STAMP]
Draws the bitmap.

Turtles (TURTLE)

This page describes the properties that the TURTLE widget offers in addition to the WIDGET and BITMAP properties.

The following commands are also implemented as callable properties so you can ASK a turtle to perform the command:

PENDOWN, PENUP, PENERASE, PENREVERSE, PEN, SETPEN, PENDOWN?, PATTERN, SETPATTERN, PENCOLOR, SETPC, WIDTH,SETWIDTH, DOT, DOT?, DOTCOLOR, FILL, STAMPOVAL, STAMPRECT, TURTLETEXT, ALPHA, and SETALPHA.

ALPHA
Controls the transparency of the colors the turtle uses to draw.
PATTERN
Reports or sets the current fill pattern.
PENCOLOR
Contains the current pen color.
PENSTATE
Controls the turtle's pen state.
PENWIDTH
Gets or sets the turtle's pen width.
SHAPE
Gets or sets the turtle's shape.

Controls

Controls are widgets that provide the standard operating system widgets like buttons, edit fields, and the like. Logo supports a number of standard controls. All controls contain the same set of properties as all widgets, plus a few extra properties.

By default, a control has a transparent background, except for buttons. You can change a control's background color and opacity by setting its BACKGROUND property.

All controls inherit the properties of the WIDGET object. They share this common set of properties:

ASK listbox-name [APPEND item]
ASK listbox-name [APPEND [item-1 item-2 …]]
Appends one or more items to the list box.
AUTOSCROLL
Gets or sets a vertical scroll bar.
BACKGROUND
Controls the background color of a control.
CAMERA
Controls which camera is active.
CAMERAS
Outputs a list of camera names.
CELLSIZE
Controls the size of all table cells.
ASK listbox-name [CLEAR]
Erases the contents of the list box.
COLOR
Controls the text color of a control.
COLOR
Controls the text color of a control.
COLUMNS
Controls the number of columns of a grid.
FILTER
Gets or sets the edit field's input filter.
ASK listbox-name [FIND text]
Finds a list box item.
INCREMENT
Controls the increment value when the slider is dragged.
INDEX
Controls the index of a selected list box item.
ASK listbox-name [INSERT item]
ASK listbox-name [INSERT [item-1 item2 …]]
Inserts one or more items into a list box.
ASK listbox-name [ITEM number]
Outputs a list box item by index.
ITEMCOUNT
Reports the number of list box items.
GPROP listbox ”ITEMS
Controls the contents of the listbox.
LIMIT
Limits the number of character that a user can enter into an edit box.
LINK
Gets or sets the video link of the video to display.
LINK
Gets or sets the video link of the video to display.
MAXIMUM
Controls the maximum value of the slider.
MINIMUM
Controls the minimum value of the slider.
MODIFIED
Reports whether the contents of an edit box have been modified.
PLACEHOLDER
Gets or sets the edit field's placeholder text.
ASK listbox-name [REMOVE number]
Removes a list box item.
ASK listbox-name [REPLACE new-text]
Replace a listbox item text.
RESOLUTION
Outputs a two-element list of the current camera resolution.
ROWS
Gets or sets the number of rows in a grid.
SELECTED
Changes the input focus to the control.
STATE
Gets or sets the Selected state of a check box or radio button.
TEXT
Gets or sets the text of the control.
TEXTALIGN
Controls the alignment of the text within the control.
TITLE
Outputs the name of the currently attached camera.
VALUE
Sets or gets the current value of a slider.

Panels

All panels (LISTENER, GRAPHICS, TOOLBOX, FILES, HELP, EDITOR, DEBUGGER) have the same core set of properties that control their layout:

BGCOLOR
Controls the background color of the Graphics panel.
BGPATTERN
Sets the background pattern.
BUTTON
Reports the state of the mouse's buttons.
KEY
Reports the last key that the user has typed.
LAYOUT
Controls the position and size of a panel.
MOUSE
Reports the position of the mouse.
OFFSET
Controls the location of the Graphic Panel's center point.
SIZE
Reports or sets the size of the widget's bounding box.
STATE
Gets or sets the Selected state of a check box or radio button.
TOUCH
Reports touch data on touch screen equipped devices.
WRAPMODE
Controls how the turtle reacts when it hits the edge of the Graphics panel.

InO-Bot Properties

inobot.jpgAn InO-Bot is a turtle-like robot, which Logo talks to just as talking to a turtle.

Logo does not TRACE or STEP these properties, but you can monitor them with WHEN or WHENEVER.

BATTERY
Reports the battery level of InO-Bot.
CALIBRATION
Controls InO-Bot's calibration factors for turns and movements.
CONNECTOR
Controls InO-Bot's external connector.
DISTANCE
Reports InO-Bot's distance to an obstacle.
FRONTLEFT
Reports the status of InO-Bot's front left obstacle sensor.
FRONTRIGHT
Reports the status of InO-Bot's front right obstacle sensor.
INFRARED
Controls InO-Bot's infrared sensor.
LIGHT
Reports the status of InO-Bot's light sensor.
LIGHTS
Controls InO-Bot's headlights.
LINELEFT
Reports the status of InO-Bot's left line sensor.
LINERIGHT
Reports the status of InO-Bot's right line sensor.
NOISELEVEL
Reports InO-Bot's microphone noise level.
REARLEFT
Reports the status of InO-Bot's rear left obstacle sensor.
REARRIGHT
Reports the status of InO-Bot's rear right obstacle sensor.

Root Robot Properties

The Root robot is a turtle-like robot, which Logo talks to just as talking to a turtle.

Logo does not TRACE or STEP these properties, but you can monitor them with WHEN or WHENEVER.

BATTERY
Reports the battery level of InO-Bot.
BUMPERLEFT
Reports the state of the robot's left bumper sensor.
BUMPERRIGHT
Reports the state of the robot's right bumper sensor.
CLIFF
Reports Root's cliff sensor.
COLORS
Reports the state of Root'S color sensor array.
LIGHT
Reports the status of InO-Bot's light sensor.
STALLED
Reports whether a motor has stalled.
TOUCHFRONTLEFT
Reports the state of Root's top front left touch sensor.
TOUCHFRONTRIGHT
Reports the state of Root's top front right touch sensor.
TOUCHREARLEFT
Reports the state of Root's top rear left touch sensor.
TOUCHREARRIGHT
Reports the state of Root's top rearright touch sensor.