SuperLogo Help - Contents

To learn how to use Help, press F1.

SuperLogo is a Windows environment designed to develop creative, logical and algorithmic thinking. The following categories and full topics linked to them provide basic information on the SuperLogo language and the SuperLogo environment.

  On the SuperLogo Language

  On the SuperLogo Environment


SuperLogo Help - Contents

To learn how to use Help, press F1.

SuperLogo is a Windows environment designed to develop creative, logical and algorithmic thinking. The following categories and full topics linked to them provide basic information on the SuperLogo language and the SuperLogo environment.

  On the SuperLogo Language

  Glossary of Basic Terms

  Categories of Procedures

  How to Use Alphabetical List of Procedures

  Alphabetical List of Procedures

  Logo Language Fundamentals

  Programming in SuperLogo

  List of Error Messages

  Colour Transformations in Loading and Saving Graphics

  On the SuperLogo Environment


SuperLogo Help - Contents

To learn how to use Help, press F1.

SuperLogo is a Windows environment designed to develop creative, logical and algorithmic thinking. The following categories and full topics linked to them provide basic information on the SuperLogo language and the SuperLogo environment.

  The SuperLogo Language

  The SuperLogo Environment

  Starting and Quitting SuperLogo

  Main Window

  Memory Window

  Editors of User Defined Objects

  File Editor

  Choosers


About SuperLogo Help ...

SuperLogo Help 1.1 - 1995 is designed and developed by

A. Blaho, S. Jager, I. Kalaš, A. Stuur and P. Tomcsányi

SuperLogo 1.1

© 1995 A. Stuur

A.W.Bruna Uitgevers B.V., Utrecht, the Netherlands

based on Comenius Logo

© 1995 A. Blaho, I. Kalaš, P. Tomcsányi

Bratislava


  How to Use The Alphabetical List of Procedures

Via the Alphabetical List of Procedures you can obtain technical details about all SuperLogo primitive procedures and special words.

Following is an example of a page describing a procedure. Its non-scrolling area starts with the name of a procedure followed by its abbreviation (if it exists). Next to that there is a short classification specifying whether the procedure is a command or an operation. Next to this the number of procedure's inputs is specified. The meaning of each small icon below the name of the procedure can be found by clicking it with the left mouse button. In the scrolling region a detailed description can be found.


  Logo Language Fundamentals

The basic building blocks of the Logo language are procedures. Logo provides nearly 300 primitive procedures; see Alphabetical List of Procedures. To program in Logo you combine simple procedures into more complex ones. We will call these procedures user-defined; they look the same and are used in the same way. What distinguishes each procedure from all others is its name. Moreover, all procedures, both primitive and user-defined, are divided into commands and operations.

  The SuperLogo Language

  Logo Language Fundamentals

  Typing Instructions in the Command Line

  Types of Data

  Turtles and Turtle Geometry

  Sounds and Multimedia

  Variables

  Inputs and Outputs of Procedures

  Conditions and Predicates, Logical Connectives

  Working with Files


Programming in SuperLogo
  Programming in SuperLogo ...

consists of defining our own procedures that solve problems, specify turtles' behaviour, drawing, make use of different data types etc.

To define your own procedures requires you to specify the order of steps to be taken. However, quite often this isn't straightforward: some steps must be repeated several times, some steps must be executed only if a condition is true etc. Logo procedures which specify the order of those steps are called control structures:

  The SuperLogo Language

  Programming in SuperLogo

  Conditional Procedures

  Repetition Commands

  RUN Procedure

  How to Define Your Own Procedures

  How to Define Your Own Operations

  Comments in Procedures

  Working with Procedures

  How and Why to Bury Objects

  How Procedures Are Debugged


   Main Window

This opens on the screen as soon as the application is started. After initialisation it is maximised to cover the full screen. It serves many purposes: from here you control the application and whole Logo environment, you type in Logo language instructions,  and watch the results of your work.

  On the SuperLogo Environment

  Main Window

  Parts of the Main Window

  Menu Bar

  Speed Bar

  Using the Keyboard

  Using the Mouse


See also...

Control Menu Commands


   Main Window

This opens on the screen as soon as the application is started. After initialisation it is maximised to cover the full screen. It serves many purposes: from here you control the application and whole Logo environment, you type in Logo language instructions,  and watch the results of your work.

  The SuperLogo Environment

  Main Window

  Parts of the Main Window

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Window Menu Commands

  Options Menu Commands

  Help Menu Commands

  Speed Bar

  Using the Keyboard

  Using the Mouse


   Main Window

This opens on the screen as soon as the application is started. After initialisation it is maximised to cover the full screen. It serves many purposes: from here you control the application and whole Logo environment, you type in Logo language instructions,  and watch the results of your work.

  The SuperLogo Environment

  Main Window

  Parts of the Main Window

  Menu Bar

  Speed Bar

  Speed Bar Buttons

  Using the Keyboard

  Using the Mouse


   Main Window

This opens on the screen as soon as the application is started. After initialisation it is maximised to cover the full screen. It serves many purposes: from here you control the application and whole Logo environment, you type in Logo language instructions,  and watch the results of your work.

  The SuperLogo Environment

  Main Window

  Parts of the Main Window

  Menu Bar

  Speed Bar

  Using the Keyboard

  Function Keys F1 to F12

  Command Line Editing Keys

  Other Keys and Their Effects

  Using the Mouse


   Main Window

This opens on the screen as soon as the application is started. After initialisation it is maximised to cover the full screen. It serves many purposes: from here you control the application and whole Logo environment, you type in Logo language instructions,  and watch the results of your work.

  The SuperLogo Environment

  Main Window

  Parts of the Main Window

  Menu Bar

  Speed Bar

  Using the Keyboard

  Using the Mouse

  Left Mouse Button

  Right Mouse Button

  Right Mouse Button in the Text Screen


  Memory Window

From here you view and interact with the contents of the Logo memory, i.e. any user-defined object. These objects can be created, loaded from a project, inspected, modified, saved as a project, or erased from here.

  The SuperLogo Environment

  Memory Window

  Parts of the Memory Window

  Menu Bar


  Memory Window

From here you view and  interact with the contents of the Logo memory, i.e. any user-defined object. These objects can be created, loaded from a project, inspected, modified, saved as a project, or erased from here.

  The SuperLogo Environment

  Memory Window

  Parts of the Memory Window

  List of Objects

  Inspection Area

  Menu Bar


  Memory Window

From here you view and interact with the contents of the Logo memory, i.e. any user-defined object. These objects can be created, loaded from a project, inspected, modified, saved as a project, or erased from here.

  The SuperLogo Environment

  Memory Window

  Parts of the Memory Window

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Objects Menu Commands

  Options Menu Commands


   User Defined Objects Editors

For a text type user-defined memory object  (a variable with a word or a list as its value, a procedure or a word with defined properties) you can use the Object Editor to create or modify the object. For a variable with an image value you can use the Image Editor to create or modify it.

  The SuperLogo Environment

  Editors of User Defined Objects

  More about the Object Editor

  More about the Image Editor

For creating or modifying text files, use the File Editor.


File Editor Window
  File Editor

In the File Editor you can read, create, or modify text files. It is a simple text editor for:

processing Logo program files, that is, files with LGO extension,

processing Logo Problems files, that is, files with TXT extension,

editing Logo's initialisation file SLOGO.INI.

If the contents of the Editor is a Logo program (the definitions of your own procedures, variables, and properties), or Logo commands with their inputs, it can be directly executed from here. More File Editor Windows can be open and used in parallel (for copying and pasting text from one file to the other, etc.). In its title bar, each File Editor Window has either the name of the edited file, or Logo Editor - [untitled], if you choose File Menu New.

  The SuperLogo Environment

  File Editor

  How to Edit in the File Editor Window

  Menu Bar

  Right Mouse Button in the File Editor


File Editor Window
  File Editor

In the File Editor you can read, create, or modify text files. It is a simple text editor for:

processing Logo program files, that is, files with LGO extension,

processing Logo Problems files, that is, files with TXT extension,

editing Logo initial file SLOGO.INI.

If the contents of the Editor is a Logo program (the definitions of your own procedures, variables, and properties), or Logo commands with their inputs, it can be directly executed from here. More File Editor Windows can be open and used in parallel (for copying and pasting text from one file to the other, etc.). In its title bar, each File Editor Window has either the name of edited file, or Logo Editor - [untitled], if you choose File Menu New .

  The SuperLogo Environment

  File Editor

  How to Edit in the File Editor Window

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands

  Execute Menu Command

  Right Mouse Button in the File Editor


Starting and Quitting Logo
  Starting and Quitting SuperLogo

If SuperLogo is installed correctly, you will find a new application window titled SuperLogo in the Program Manager Window with the following icon:

  Alternative Options in the Windows Command Line

To start it, either double-click the icon or click it and press the Enter key. The SuperLogo Main Window opens on the screen.

To do the same without the mouse, you select the SuperLogo application window (if there are more active applications running, use Alt+Tab to cycle them to choose Program Manager, then use Ctrl+F6 until the SuperLogo window is highlighted). If there are more icons within the same application window, use arrow keys to highlight the right one and then press the Enter key.

To quit the application, either double-click the application window control menu button, or select the File menu Exit Logo command (Alt, F,X), or type BYE in the text screen. A dialogue box then appears asking:

SuperLogo is being closed?

Do you want to save your work?

Here you can choose either Yes, No or Cancel to save, quit, or cancel this dialogue and continue the work.


On Choosers
  Choosers

Choosers are special pop-up windows and dialogue boxes designed to facilitate our work in SuperLogo. They help you type in correct inputs, they provide different graphics and textual tools, hints and menus etc.

  The SuperLogo Environment

  Choosers

  Choosers are Divided Into...

  How to Open a Chooser

  Buttons in a Chooser

  List of All Special Choosers

  Universal Chooser

  List of Commands Window

  Buttons Window


List of All Choosers
  List of All Special Choosers

  The SuperLogo Environment

  Choosers

  List of All Special Choosers

  Number of Steps

  Line Patterns

  Colours

  Colours (16 colours)

  Fill Pattern

  Pen Width

  ToTurn

  Co-ordinates

  Rectangle

  Choose an Image

  Choose a Frame

  Set Mouse Cursor

  Play Wave

  Load Screen

  Save Screen As

  Set Font

  Line to Debug

  Set Text Colour

  Make a Turtle

  Write Text


I belong to ...

  On the SuperLogo Language


I belong to ...

  On the SuperLogo Environment


I belong to ...

    On Choosers


Standard Elements ...

All of these elements are either standard Windows elements, like control menu in the upper left corner, or standard Windows Help elements, like menu commands File, Edit etc., and buttons Contents, Search, Back etc.


Glossary Button ...

is an additional button in SuperLogo Help. When pressed, it opens a page containing the whole alphabet of the definitions of terms essential to SuperLogo.


ABC Button ...

is an additional button in SuperLogo Help. When pressed, it opens a page containing the complete alphabetical list of all Logo primitive procedures.


Name of the Procedure ...

Here you will find complete and abbreviated (if it exists) English name/names of the procedure.


Number of Inputs ...

This area specifies:

whether this Logo primitive procedure is a command or an operation,

 its number of inputs. Note that Logo distinguishes between a basic and variable number of inputs.


Category Classification ...

The text behind this icon specifies the category to which this procedure belongs. Quite often one procedure belongs to two or even three categories.


See Also ...

Here you will find the list of all Logo primitive procedures which are similar to this one.


Example 1 ...

You will find this icon with procedures which have some examples accompanying them. If you click the icon, the SuperLogo Help Example Window opens containing its own icons and text to be read and tried out in SuperLogo.


Example 2 ...

Some procedures are accompanied with more than one example. If you click the icon, the SuperLogo Help Example Window opens containing its own icons and text to be read and tried out in SuperLogo.


Advanced Features ...

You will find this icon with those procedures  which have more advanced features. When you click the icon, you jump to the second page describing the procedure. In this way we divide the complete procedures description into two separate pages. The advanced page may contain some more alternatives concerning the inputs etc.


Chooser ...

You will find this icon with those procedures which have their own chooser associated with them. When you click the icon, you jump to the page describing the chooser.


Description of Inputs ...

Here you will find a detailed description of all a procedures inputs, their types, the way they are used with this procedure, all alternative formats etc.


Description of the Procedure ...

Here you will find a detailed description of the procedures purpose, how it co-operates with other Logo primitive procedures etc.


  Alphabetical List of Procedures

The following list contains all commands, operations and words with special meanings provided in the SuperLogo language. Some of these procedures have abbreviations to save typing. They often make definitions shorter and more readable. Therefore we have included abbreviations both directly in the list and together with their full equivalent.

Commands, operations and words are classified into nineteen categories depending on what they are used for. See Categories of Procedures for a more detailed description of each category together with the list of related procedures and words.

- A -

ABS

ALL

ALLTURTLES;  ALL

AND

APPEND

APPLY

ARCTAN

ASCII

ASK

- B -

BACK;  BK

BACKGROUND;  BG

BF

BG

BK

BL

BURIED

BURY

BURYALL

BUTFIRST;  BF

BUTLAST;  BL

BUTMEMBER

BUTTONS

BUTTONSSIZE

BYE

- C -

CASE

CATCH

CHAR

CHOOSER

CLEAN

CLEARSCREEN;  CS

CLEARTEXT;  CT

CLIPBOARD

CLOSEPROBLEM

CLOSEVIDEO

CODEAREA

COS

COUNT

CS

CT

CURSOR

- D -

DATE

DATEW

DATEWORD;  DATEW

DEBUG

DEC

DEFINE

DEFINED?

DIFFERENCE

DIR

DIV

DOT

DOTCOLOUR

DRAW

- E -

EACH

ED

EDFILE

EDIT;  ED

EDITFILE;  EDFILE

EMPTY?

EMPTYIMAGE

END

EOF?

EQUAL?

ER

ERALL

ERASE;  ER

ERASEFILE;  ERFILE

ERASETURTLE;  ERTURTLE

ERFILE

ERROR

ERTURTLE

EXP

- F -

FALSE

FC

FD

FILE?

FILL

FILLCOLOUR;  FC

FILLPATTERN;  FP

FILTER

FIRST

FOR

FOREACH

FORWARD;  FD

FP

FPUT

FRAME

FROMMEMBER

- G -

GENERATE

GETBOX

GETGS

GETIMAGE

GETSHAPE

GETTS

GETWINDOW

GPROP

GRAPHICSCREEN;  GS

GREATER?

GS

- H -

HEADING

HIDEBUTTONS

HIDESPEEDBAR

HIDETURTLE;  HT

HOME

HOTSPOT

HT

- I -

IF

IFF

IFFALSE;  IFF

IFT

IFTRUE;  IFT

IGNORE

IMAGE

IMAGE?

IMAGESIZE

INC

INSIDE?

INT

ITEM

- J -

- K -

KEY?

- L -

LAST

LEFT;  LT

LESS?

LET

LIST

LIST?

LN

LOAD

LOADBITMAP

LOADIMAGE

LOADLIB

LOADLIBRARY;  LOADLIB

LOADPATH

LOADPROBLEM

LOADSCREEN

LOCAL

LOGO

LOGOSIZE

LPUT

LT

- M -

MAKE

MAKEERROR

MAKETURTLE

MAP

MCI

MEMBER

MEMBER?

MESSAGEBOX

MOD

MOUSE

MOUSESTATE

- N -

NAME

NAME?

NAMES

NOT

NUMBER?

- O -

OP

OPENVIDEO

OR

OUTPUT;  OP

OUTSIDE?

OVERLAP?

OVERLAPPED

- P -

PATH

PATTERN

PAUSE

PC

PD

PE

PEN

PENCOLOUR;  PC

PENDOWN;  PD

PENERASE;  PE

PENREVERSE; PX

PENSTATE

PENUP;  PU

PENWIDTH;  PW

PICK

PL

PLAY

PLAYW

PLAYWAVE;  PLAYW

PLIST

PO

POLYGON

POLYGONLINE

POS

POTS

PPROP

PPS

PR

PRIMITIVE?

PRINT;  PR

PRINTG

PRINTGRAPHICS,  PRINTG

PRINTLINE;  PL

PRINTM

PRINTMEMORY;  PRINTM

PRINTT

PRINTTEXT;  PRINTT

PRINTTO

PROCS

PRODUCT

PROPS

PU

PUTIMAGE

PW

PX

- Q -

QUOTIENT

- R -

RANDOM

RANDOMIZE

RC

READCHAR;  RC

READFROM

READKEY

READLIST;  RL

READLISTDIALOG;  RLD

READLISTTURTLE;  RLT

READWORD;  RW

REMPROP

REORDER

REPC

REPCOUNT;  REPC

REPEAT

REPLACE

RESETPAL

RESETPALETTE;  RESETPAL

RIGHT;  RT

RL

RLD

RLT

ROUND

RT

RUN

RUNPROG

RUNPROGRAM;  RUNPROG

RW

- S -

SAVE

SAVEBITMAP

SAVEIMAGE

SAVELIB

SAVELIBRARY;  SAVELIB

SAVESCREEN

SE

SENTENCE;  SE

SETBACKGROUND;  SETBG

SETBG

SETBOX

SETBOXMODE

SETBURY

SETBUTTONS

SETBUTTONSSIZE

SETCURSOR

SETFC

SETFILLCOLOUR;  SETFC

SETFILLMODE

SETFILLPATTERN;  SETFP

SETFORMAT

SETFP

SETGS

SETH

SETHEADING;  SETH

SETHOTSPOT

SETIMODE

SETLOGO

SETLOGOSIZE

SETMC

SETMOUSECURSOR;  SETMC

SETPATH

SETPATTERN

SETPC

SETPEN

SETPENCOLOUR;  SETPC

SETPENSTATE

SETPENWIDTH; SETPW

SETFRAME

SETFRAMEMODE

SETPLIST

SETPOS

SETPROMPT

SETPW

SETREADLISTPROMPT; SETRLPROMPT

SETRLPROMPT

SETSHAPE

SETSHAPECOLOUR

SETTC

SETTS

SETTT

SETTTEXT;  SETTT

SETX

SETXY

SETY

SH

SHAPECOLOUR

SHAPEPOS

SHOW;  SH

SHOWBUTTONS

SHOWN?

SHOWSPEEDBAR

SHOWTURTLE;  ST

SHUFFLE

SIN

SOUND

SPLITSCREEN;  SS

SQRT

SS

ST

STAMP

STOP

SUM

SYSTEMMETRICS

- T -

TAN

TELL

TEST

TEXT

TEXTSCREEN;  TS

TEXTSIZE

THING

THROW

TIME

TIMEW

TIMEWORD;  TIMEW

TO

TOPLEVEL

TOUCHED

TOWARDS

TRUE

TS

TT

TTEXT;  TT

TURTLESTATE

TYPE

- U -

UNBURY

- V -

- W -

WAIT

WAITUNTIL

WHILE

WHO

WINDOW

WORD

WORD?

WRAP

- X -

XCOR

- Y -

YCOR

- Z -

- ... -

*

+

-

/

.CLEANMEM

.PRIMITIVES

.REVERSE

.SETMOUSEPOS

.WINDOWSPOS

<

<=

<>

=

>

>=


  Categories of Procedures

SuperLogo procedures, i.e. commands and operations, and all words with special meanings are classified into nineteen categories. Several procedures or words are listed in more than one category.

Numeric Operations

Numeric Predicates

Word and List Operations

Property List Procedures

Logical Operators and Words

Naming and Using Variables

Controlling and Conditional Procedures

Defining, Editing and Working with Procedures

Turtle Geometry

Working with Images

Working with Screen

Working with Choosers and Buttons

Input and Output

Files Management

Using the Mouse

Music Primitives and Multimedia

Managing Workspace

Miscellaneous

Quitting


Category: Numeric Operations
  Numeric Operations

Numeric operations are procedures with one, two or more numeric inputs and a numeric output. This output is then used by another operation or command (e.g. turtle geometry commands, procedures naming and using variables, or controlling and conditional procedures).

*

+

-

/

ABS

ARCTAN

COS

DIFFERENCE

DIV

EXP

INT

LN

MOD

PRODUCT

QUOTIENT

RANDOM

RANDOMIZE

ROUND

SIN

SQRT

SUM

TAN


Category: Numeric Predicates
  Numeric Predicates

Numeric predicates are procedures usually with two inputs. Their output is either TRUE or FALSE depending on whether a certain condition (predicate) is fulfilled or not. The output of numeric predicates is used by other operations (e.g. logical operators) or commands in the language (controlling and conditional procedures etc.).

<

<=

>

>=

<>

=

EQUAL?

GREATER?

LESS?


Category: Word and List Operations
  Word and List Operations

These operations are procedures with words and lists as their inputs. Their output is used by other operations (numeric, word and list operations, numeric predicates, logical operators) or SuperLogo commands (files management commands, commands naming and using variables, controlling procedures, turtle geometry procedures, input and output commands etc.).

<

<=

>

>=

<>

=

ASCII

BF

BL

BUTFIRST;  BF

BUTLAST;  BL

BUTMEMBER

CHAR

COUNT

EMPTY?

EQUAL?

FIRST

FPUT

FROMMEMBER

GREATER?

ITEM

LAST

LESS?

LIST

LIST?

LPUT

MEMBER

MEMBER?

NUMBER?

PICK

REPLACE

SE

SENTENCE;  SE

SHUFFLE

WORD

WORD?

.REVERSE


Category: Property List Procedures
  Property List Procedures

This category includes commands and operations that allow you to assign multiple attributes - called properties, - to a word. They also allow modifying, using and removing properties. If the same word is also a name of a variable, its value is completely independent of the properties defined for this word.

BURIED

BURY

BURYALL

ED

EDIT;  ED

ER

ERALL

ERASE;  ER

GPROP

PLIST

PPROP

PPS

PROPS

REMPROP

SETBURY

SETPLIST

UNBURY


Category: Logical Operators and Words
  Logical Operators and Words

This category contains words TRUE and FALSE and operations with one, two or more inputs which must always be either TRUE or FALSE. These operations output a TRUE or FALSE result which is then processed as an input by other Logo operations and commands, for example, to control the flow of instructions.

AND

FALSE

NOT

OR

TRUE


Category: Naming and Using Variables
  Naming and Using Variables

This category includes operations and commands which allow you to define, modify, erase or bury variables and to recall their values which can then used as inputs by other operations or commands. In Logo types of variables are not distinguished in the name of the variable.

BURIED

BURY

BURYALL

DEC

ED

EDIT;  ED

ER

ERALL

ERASE;  ER

INC

LET

LOCAL

MAKE

NAME

NAME?

NAMES

SETBURY

THING

UNBURY


Category: Controlling and Conditional Procedures
  Controlling and Conditional Procedures

These are operations and commands which call, stop or branch the flow of instructions, sometimes depending on whether certain conditions (predicates) are fulfilled. Their inputs are words and/or lists. These lists are in certain cases executed (run) as  Logo lists instructions of the language.

APPLY

CASE

CATCH

DEBUG

ERROR

FILTER

FOR

FOREACH

GENERATE

IF

IFF

IFFALSE;  IFF

IFT

IFTRUE;  IFT

IGNORE

MAKEERROR

MAP

OP

OUTPUT;  OP

PAUSE

REPC

REPCOUNT;  REPC

REPEAT

RUN

STOP

TEST

THROW

TOPLEVEL

WAIT

WAITUNTIL

WHILE


Category: Defining, Editing, and Working with Procedures
  Defining, Editing, and Working with Procedures

This category includes operations and commands which allow you to define, modify, erase, bury, print out or classify procedures - either primitives or user-defined. Most of these actions can be also be run via menu commands from the SuperLogo Memory Window.

BURIED

BURY

BURYALL

DEFINE

DEFINED?

ED

EDIT;  ED

END

ER

ERALL

ERASE;  ER

PO

POTS

PRIMITIVE?

PROCS

TEXT

TO

.PRIMITIVES


Category: Turtle Geometry
  Turtle Geometry

Operations and commands in this category allow you to initialise turtles and make them draw onto the graphics screen, to clean the screen, to modify the state of the turtles pens (colour, width, pattern etc.), to print text, to stamp images into the graphics screen etc.

ALL

ALLTURTLES;  ALL

ASK

BACK;  BK

BK

CLEAN

CLEARSCREEN;  CS

CS

DOT

DOTCOLOUR

DRAW

EACH

ERALL

ERASETURTLE;  ERTURTLE

ERTURTLE

FC

FD

FILL

FILLCOLOUR;  FC

FILLPATTERN;  FP

FORWARD;  FD

FP

GETBOX

GETIMAGE

GETSHAPE

GETWINDOW

HEADING

HIDETURTLE;  HT

HOME

HT

INSIDE?

LEFT;  LT

LT

MAKETURTLE

OUTSIDE?

OVERLAP?

OVERLAPPED

PATTERN

PC

PD

PE

PEN

PENCOLOUR;  PC

PENDOWN;  PD

PENERASE;  PE

PENREVERSE; PX

PENSTATE

PENUP;  PU

PENWIDTH;  PW

PHASE

POLYGON

POLYGONLINE

POS

PU

PUTIMAGE

PW

PX

READLISTTURTLE;  RLT

REORDER

RIGHT;  RT

RLT

RT

SETBOX

SETBOXMODE

SETFC

SETFILLCOLOUR;  SETFC

SETFILLMODE

SETFILLPATTERN;  SETFP

SETFP

SETH

SETHEADING;  SETH

SETPATTERN

SETPC

SETPEN

SETPENCOLOUR;  SETPC

SETPENSTATE

SETPENWIDTH; SETPW

SETFRAME

SETFRAMEMODE

SETPOS

SETPW

SETSHAPE

SETSHAPECOLOUR

SETTT

SETTTEXT;  SETTT

SETX

SETXY

SETY

SHAPECOLOUR

SHAPEPOS

SHOWN?

SHOWTURTLE;  ST

ST

STAMP

TELL

TEXTSIZE

TOWARDS

TT

TTEXT;  TT

TURTLESTATE

WHO

WINDOW

WRAP

XCOR

YCOR


Category: Working with Images
  Working with Images

Procedures in this category work with images, they produce images by grabbing parts of the graphics screen, they read or save them into files and/or put them onto the screen elsewhere.

EMPTYIMAGE

GETIMAGE

GETSHAPE

HOTSPOT

IMAGE

IMAGE?

IMAGESIZE

LOADBITMAP

LOADIMAGE

PATH

FRAME

PUTIMAGE

SAVEBITMAP

SAVEIMAGE

SETHOTSPOT

SETIMODE

SETPATH

SETFRAME

SETFRAMEMODE

SETSHAPE

SETSHAPECOLOUR

SHAPECOLOUR

SHAPEPOS

The following procedures - listed in the Word and List Operations category - also work for images:

=

BF

BL

BUTFIRST;  BF

BUTLAST;  BL

COUNT

EMPTY?

EQUAL?

FIRST

FPUT

ITEM

LAST

LIST

LIST?

LPUT

PICK

REPLACE

SE

SENTENCE;  SE

SHUFFLE

.REVERSE


Category: Working with the Screen
  Working With The Screen

This category includes procedures which define the way the client area of the Main Window is divided into parts and modifies the state of both graphics screen and text screen. These procedures clean both screens, set the background colours, show and hide the Speed Bar etc.

BACKGROUND;  BG

BG

CLEAN

CLEARSCREEN;  CS

CLEARTEXT;  CT

CS

CT

CURSOR

DOTCOLOUR

DRAW

GETGS

GETTS

GRAPHICSCREEN;  GS

GS

HIDESPEEDBAR

LOADSCREEN

 	LOGOSIZE

PRINTG

PRINTGRAPHICS,  PRINTG

PRINTT

PRINTTEXT;  PRINTT

RESETPAL

RESETPALETTE;  RESETPAL

SAVESCREEN

SETBACKGROUND;  SETBG

SETBG

SETCURSOR

SETGS

SETLOGOSIZE

SETMC

SETMOUSECURSOR;  SETMC

SETPROMPT

SETREADLISTPROMPT; SETRLPROMPT

SETRLPROMPT

SETTC

SETTS

SHOWSPEEDBAR

SPLITSCREEN;  SS

SS

TEXTSCREEN;  TS

TS

.SETMOUSEPOS

.WINDOWSPOS


Category: Working with Choosers and Buttons
  Working with Choosers and Buttons

This category includes commands and operations which make it possible to open and close some of Logo choosers and the Speed Bar directly from your program.

BUTTONS

BUTTONSSIZE

CHOOSER

CLOSEPROBLEM

HIDEBUTTONS

HIDESPEEDBAR

LOADPROBLEM

SETBUTTONS

SETBUTTONSSIZE

SHOWBUTTONS

SHOWSPEEDBAR


Category: Input and Output
  Input and Output

Commands and operations in this category take input from the graphics screen or from the text screen, from the keyboard or from a file (i.e. from actual input stream) and output to the graphics screen and text screen or a file. They also print out all user-defined procedures, or their titles.

CHAR

CLIPBOARD

KEY?

MESSAGEBOX

PL

PO

POTS

PR

PRINT;  PR

PRINTG

PRINTGRAPHICS,  PRINTG

PRINTLINE;  PL

PRINTM

PRINTMEMORY;  PRINTM

PRINTT

PRINTTEXT;  PRINTT

PRINTTO

RC

READCHAR;  RC

READFROM

READKEY

READLIST;  RL

READLISTDIALOG;  RLD

READLISTTURTLE;  RLT

READWORD;  RW

RL

RLD

RLT

RW

SETFORMAT

SETPROMPT

SETREADLISTPROMPT; SETRLPROMPT

SETRLPROMPT

SH

SHOW;  SH

TYPE


Category: File Management
 File Management

Operations and commands in this category allow you to load and save bitmaps, images, libraries, and text files, to assign input and output streams (i.e. to specify from where you are going to read and where you are going to print), to define working directories etc. They allow you to load and save different kinds of files.

APPEND

CLIPBOARD

DIR

EDFILE

EDITFILE;  EDFILE

EOF?

ERASEFILE;  ERFILE

ERFILE

FILE?

LOAD

LOADBITMAP

LOADIMAGE

LOADLIB

LOADLIBRARY;  LOADLIB

LOADPATH

LOADSCREEN

PATH

PRINTTO

READFROM

SAVE

SAVEBITMAP

SAVEIMAGE

SAVELIB

SAVELIBRARY;  SAVELIB

SAVESCREEN

SETPATH


Category: Using the Mouse
  Using the Mouse

It is possible to include mouse data in your programs, i.e. to manage information coming from mouse - both clicks on an object (for example on a turtle) or drags.

CODEAREA

KEY?

MOUSE

MOUSESTATE

READKEY

SETMC

SETMOUSECURSOR;  SETMC

TOUCHED

.SETMOUSEPOS


Category: Music Primitives and Multimedia
  Music Primitives and Multimedia

These commands allow you to control multimedia, to generate sounds and to interpret musical notes and special musical commands described in their input lists.

CLOSEVIDEO

MCI

OPENVIDEO

PATH

PLAY

PLAYW

PLAYWAVE;  PLAYW

SETPATH

SOUND


Category: Managing Workspace
  Managing Workspace

The only command in this category does general garbage collection: it recycles the whole area of SuperLogo workspace which is no longer being actively occupied.

.CLEANMEM


Category: Miscellaneous
  Miscellaneous

This category consists of SuperLogo commands that communicate with Windows systems, finding date and time, running another application, etc.

DATE

DATEW

DATEWORD;  DATEW

LOGO

RUNPROG

RUNPROGRAM;  RUNPROG

SETLOGO

SYSTEMMETRICS

TIME

TIMEW

TIMEWORD;  TIMEW


Category: Quitting
  Quitting

The only command in this category closes the SuperLogo application and enters either other active application or Windows' Program Manager.

BYE


I belong to ...

  Categories of Procedures


Category Classification...

Turtle Geometry

See also...

Turtles and Turtle Geometry...

Multiple Turtles...

Turtle Settings...

Procedures controlling Turtles...


Category Classification...

Working with Screen

See also...

Splitting the Main Window into Two Screens...


Category Classification...

Property List Procedures

Naming and Using Variables

Defining, Editing and Working with Procedures

See also...

What Are Variables...

Editing the Value of a Variable ...

Procedures to Work with Properties...

Working with Procedures...


Category Classification...

Word and List Operations

Working with Images

See also...

Words - Symbolic Atoms of Logo Language...

Words Can Be Compared ...

Escape Character \ and "Forbidden Words"...

Priorities: The Order of Calculations...

Types of Data...


Category Classification...

Working with Choosers and Buttons

See also...

List of Commands Window...

Buttons Window...


Category Classification...

Quitting

See also...

Starting and Quitting SuperLogo...

Alternative Options in the Windows Command Line...


Category Classification...

Input and Output

See also...

How to Read from and Print to a File...

Printing To and Reading From a File...

Procedures to Load and Save Files...


Category Classification...

Controlling and Conditional Procedures

See also...

Long Lines in Procedures' Definitions...

TEST, IFTRUE, and IFFALSE - Another Alternative to IF...

Where to Use TEST, IFFALSE, and IFTRUE...


Category Classification...

Word and List Operations

Input and Output

See also...

Words - Symbolic Atoms of Logo Language...

Words Can Be Compared...

Escape Character \ and "Forbidden Words"...

Priorities: The Order of Calculations...


Category Classification...

Turtle Geometry

Working with Screen

See also...

Turtles and Turtle Geometry

Multiple Turtles

Splitting the Main Window into Two Screens


Category Classification...

Input and Output

Files Management

See also...

Working with Files...

Procedures to Load and Save Files...


Category Classification...

Using the Mouse


Category Classification...

Numeric Operations

See also...

Priorities: The Order of Calculations...

The Number of Decimal Places Displayed...


Category Classification...

Miscellaneous


Category Classification...

Naming and Using Variables

See also...

What Are Variables...

Editing the Value of a Variable ...

Buried Objects...

How and Why You Bury Memory Objects...


Category Classification...

Defining, Editing and Working with Procedures

See also...

Working with Procedures...

Buried Objects...

How and Why You Bury Memory Objects...


Category Classification...

Files Management

See also...

Creating and Using a Library...

Working with Files...

Procedures to Load and Save Files...


Category Classification...

Working with Images

See also...

Images...

Types of Data...


Category Classification...

Numeric Predicates

Word and List Operations

Working with Images

See also...

What Are Predicates...

Priorities: The Order of Calculations...

The Order of Calculations with Numeric Predicates...

Words - Symbolic Atoms of Logo Language...

Words Can Be Compared...

Escape Character \ and "Forbidden Words"...


Category Classification...

Property List Procedures

Naming and Using Variables

Defining, Editing and Working with Procedures

Turtle Geometry

See also...

Procedures to Work with Properties...

What Are Variables...

Editing the Value of a Variable ...

Working with Procedures...


Category Classification...

Logical Operators and Words

See also...

What Are Predicates...

Inputs to a Procedure...


Category Classification...

Turtle Geometry

Working with Images

See also...

Turtles and Turtle Geometry...

Multiple Turtles...

Turtle Settings...

Procedures with Turtles...

Images...


Category Classification...

Property List Procedures

See also...

Procedures to Work with Properties...

Buried Objects...

How and Why You Bury Memory Objects...


Category Classification...

Numeric Predicates

Word and List Operations

See also...

What Are Predicates...

Priorities: The Order of Calculations...

The Order of Calculations with Numeric Predicates...

Words - Symbolic Atoms of Logo Language...

Words Can  Be Compared ...

Escape Character \ and "Forbidden Words"...


Category Classification...

Working with Screen

Working with Choosers and Buttons

See also...

Splitting the Main Window into Two Screens...

List of Commands Window...

Buttons Window...


Category Classification...

Input and Output

Communicating by Mouse

See also...

How to Read from and Print to a File...

Printing To and Reading From a File...


Category Classification...

Working with Images

Files Management

See also...

Images...

Working with Files...

Procedures to Load and Save Files...


Category Classification...

Working with Screen

Files Management

See also...

Splitting the Main Window into Two Screens...

Working with Files...

Procedures to Load and Save Files...


Category Classification...

Music Primitives and Multimedia

See also...

Sounds and Multimedia...


Category Classification...

Word and List Operations

See also...

Words - Symbolic Atoms of Logo Language...

Words Can Be Compared ...

Escape Character \ and "Forbidden Words"...

Priorities: The Order of Calculations...


Category Classification...

Defining, Editing and Working with Procedures

Input and Output

See also...

Working with Procedures...

Buried Objects...

How and Why You Bury Memory Objects...


Category Classification...

Working with Screen

Input and Output

See also...

Splitting the Main Window into Two Screens...

How to Read from and Print to a File...

Printing To and Reading From a File...


Category Classification...

Turtle Geometry

Input and Output

See also...

Turtles and Turtle Geometry...

Multiple Turtles...

Turtle Settings...

Procedures With Turtles...


Category Classification...

Working with Screen

Communicating by Mouse

See also...

Splitting the Main Window into Two Screens...


Category Classification...

Managing Workspace


Glossary of Basic Terms
  Glossary of Basic Terms and Concepts

The following list contains all the basic terms and concepts together with a short definition. These terms are used to specify inputs to Logo primitive procedures.

- A -

abbreviation

active procedure

active shape colour

active turtle

angle

any

- B -

basic heading

BMP file name

boolean value

button definition

- C -

case in words

character

Clipboard

colour

command

command line

complete error message

conditional procedure

- D -

definition list

demo project

directory

- E -

error message

expression

extension

- F -

file extension

file name

fill pattern

filter

font

frames of images

- G -

global variable

graphics screen

- H -

heading

home directory

home position

hot spot of an image

- I -

ICON variable

image

input to a Logo procedure

- J -

- K -

- L -

length of words

LGO file

LGP file

LGW file

library

list

list of Logo instructions

list of button definitions

list of memory objects

list of points

list of properties

list of turtles

list of words

local variable

logical value

Logo instruction

Logo procedure

Logo subdirectory

long line

- M -

memory object

- N -

name of procedure

name of turtle

name of variable

number

- O -

object

operation

Origin of the graphics screen

- P -

path

pen pattern

pen width

point

polygon list

position

predicate

printer flag

problem

procedure

procedural object

project

prompt

property

property list

- Q -

- R -

readlist prompt

rectangle

- S -

screens in projects

segments of items

sentence

shape colour

slider text box

SLOGO.INI file

STARTUP procedure

subdirectory

- T -

text

text box turtle

text prompt

text screen

turtle name

TXT file name

- U -

user-defined object

user-defined procedure

- V -

variable global

variable local

variable, name of

- W -

WAV file

width

Windows Command Line

word

work directory

- X -

- Y -

- Z -

Zzzzz...


Basic Definitions - Abbreviation...
Abbreviations ...

Several Logo procedures have alternative short names - abbreviations. These are especially for frequently used procedures with long names. Abbreviations save space and make instructions more readable.

For example, you can type:

FD	instead of	FORWARD

LT	instead of 	LEFT

BG	instead of	BACKGROUND etc.


Basic Definitions - Active Procedure...
Active Procedure ...

is any user-defined Logo procedure which has not yet finished running. When control is at the top level, that is, at the dialogue level, there are no active procedures.


Basic Definitions - Active Shape Colour...
Active Shape Colour ...

is any of the basic 16 colours. If a turtle has an active shape colour specified (that is, if SHAPECOLOUR operation for this particular turtle doesn't output the empty list), then all points of this colour in the actual turtle's shape will always be replaced by the actual colour of the turtle's pen. For example:

? ERTURTLE ALL

? MAKETURTLE 0 (SE 0 0 270 "PU "ST LOADIMAGE "CARS.LGW [1 1] "TELL)

? SETSHAPECOLOUR 14

? REPEAT 10 [SETPC RANDOM 15 STAMP FD 35]


Active Turtle
Active Turtle ...

is any turtle which is actually a member of the WHO list. To make a turtle active, use TELL.

When a turtle is created or recreated with MAKETURTLE, it immediately becomes the youngest turtle, that is the last turtle of the ALLTURTLES list. The order of turtles in the ALLTURTLES list can be changed with REORDER and is important when some turtles' shapes are overlapping on the screen - the younger the turtle is, the fewer turtles can cover it with their shapes. The youngest turtle is always on the top of all others.

The active turtle is said to be the first active turtle, if it is the first member of the ALLTURTLES list. That is, if it is the oldest turtle.


Basic Definitions - Angle...
Angle ...

is any number between 0 and 360 inclusive. This number specifies the heading of a turtle and in Logo is always measured in degrees. North is represented by the angle 0, East is represented by the angle 90, etc.


Basic Definitions - Any...
Any ...

is any data object considered a valid value for a variable in SuperLogo. It can be either a word, a list or an image. No other data type is accepted as an input to a Logo procedure.


Basic Definitions - Basic Heading
A Turtle's Basic Heading...

is an angle specified for each turtle at the time it is created with MAKETURTLE. Although the turtle's actual heading can be changed any time, the turtle remembers its basic heading and is set to it whenever you use CLEARSCREEN.


Basic Definitions - BMP File...
BMP File ...

is any file containing a standard Windows bitmap. Although it is not necessary, its extension is most often .BMP. The contents of such file has its own specified palette and size, that is, width and height.


Basic Definitions - Button definition...
Button Definition ...

is a list containing all information concerning a button in the Buttons Window. It may be one of the following forms:

[ ]

[instruction1 ... instructionN]

[command]

[ text [instructions ... ] ]

[ text [instructions ... ] [X Y w h] ]

[ text [command ] [X Y w h] ]

[ image [instructions ... ] ]

[ image [instructions ... ] [X Y w h] ]

[ any any [0 0 0 0] ]

  See detailed description of each type of button definition


Basic Definitions - Button definition...
More on Button Definition

[ ]	the empty list meaning that the button is undefined. That is, it has no text/graphics and no behaviour associated with itself and it has the basic (default) size. If a button with "no" definition is pressed, nothing happens. If you re-define any button to be [ ], it is restored to its default size with no text and no behaviour,

[instruction1 ... instructionN] the list of one or more Logo instructions instruction1, ... together with their inputs. Procedures used in the list may be both primitive or user defined. This form can be used when the complete text fits on the button and the behaviour associated with it is identical with the text. For example:

[FD 100 RT 90]

[My.procedure "A "B]

are legal definitions. If the text is too long for the button, it is truncated to fit available space. If the button with [instruction1 ... instructionN] definition is pressed, the instructions are typed into the command line of the text screen and are immediately acted upon,

[command]	the name of a Logo primitive command with no inputs. If the button with this definition is pressed, a chooser associated with the command opens, see more about the Buttons Window,

[ text [instructions ... ] ] or

[ text [instructions ... ] [X Y w h] ] or

[ text [command ] [X Y w h] ] where text is either a word or a sentence - it will appear on the button as text. The second member of the list is a list of Logo instructions that define the button's behaviour. (If the second list contains only a Logo command with no inputs, it behaves as described above.)

The optional third member of the list specifies the position [X Y] of the upper left corner of the button relative to the upper left corner of the client area of the Buttons Window. Numbers w and h specify the button's width and height. If you press the button, all the instructions are copied into the text screen and evaluated. If you want the instructions only to be copied into the command line without being evaluated, you have to enter # as the first character of the list [instructions ... ]. For example:

[ square [repeat 4 [fd 100 rt 90] ] ]

[ [Press me!] [CS SETPW 2 Do.it] [1 45 60 45] ]

[ [Save my drawing] [ #S ] ]

[ image [instructions ... ] ] or

[ image [instructions ... ] [X Y w h] ] where image is either a name of an LGW file, for example "FLAGS, or a variable with an image value, like :CARS, or an image value. The optional third input is the same as above,

[ any any [0 0 0 0] ] if the third input is the list of 4 zeros, the button is hidden. It cannot be pressed. To reset it to its default mode - normal size with no contents, you have to specify this button to be [ ].


Basic Definitions - Character...
Character ...

is an atomic building data block for SuperLogo words. It is either a digit 0 through 9, a capital letter A through Z, a lowercase letter a through z and all other valid symbols like !, <, ?, & etc. However, some of these symbols have special meanings in SuperLogo and must be used carefully.

Escape Character \ and "Forbidden Words"...

When used as an input to a Logo procedure, a character is always considered being a word of the length 1.


Basic Definitions - Clipboard...
Clipboard ...

is a temporary storage area in Windows memory for copied or cut user-defined objects, texts or graphics. You can make use of the Clipboard to move memory objects within the Object Editor, texts within the File Editor, from one procedure's definition to the other, you can put the actual contents of the graphics screen in the Clipboard, cut text from one place and paste it to the other, you can paste the contents of the Clipboard into the command line of the text screen (and execute it), you can move small graphics from other Windows applications into the Image Editor etc.

Text and graphics are always put onto the Clipboard with Cut or Copy and with several Logo primitive commands like LOAD, SAVE, LOADIMAGE etc. The Clipboard holds the information until you cut or copy another piece of text or graphics onto it. The actual contents of the Clipboard is placed at the new location with the Paste command.

See also Logo procedure CLIPBOARD


Basic Definitions - Colour Number...
Colour Number ...

is either:

an integer between 0 and 15, inclusive, denoting one of the solid colours of 16-colours basic palette,

a list [R G B] of three integers between 0 and 255, inclusive, denoting a colour from the extended palette. Three numbers express how much of R - red, G - green and B - blue colour is present in the final mixture. The way in which [R G B] colours are displayed on the screen depends on particular graphic card and settings of Windows. Whenever Windows is not able to display a colour as a solid colour, it uses a pattern of dots of different colours to simulate it. You call such colour a nonsolid colour.


Basic Definitions - Command Line...
Command Line ...

is an editing line on the text screen. It begins with the text prompt or the readlist prompt or special character (>) denoting that you are defining a procedure, see TO. In the command line you type Logo instructions or any data expected and processed by a running program.

The contents of the command line may be longer than 80 characters. In this case it is automatically wrapped into the following line (or lines). If you want to finish  the command line and let Logo evaluate its contents, press Enter.

If you press Esc instead of Enter, the command line is cleared and nothing happens.

Command Line Editing Keys


Basic Definitions - Complete Error Message...
Complete Error Message ...

is the output of ERROR, whenever an error occurs in instructions or procedures. It contains the number of the error, its message, the name of the user-defined procedure (or [ ], if the error happened in the command line) and the number of the line in which the error took place (or 0, if the error happened in the command line), plus the name of procedure and the value which caused the error:

? CATCH "ERROR ["A] SH ERROR

[1 [I don't know what to do with A][ ] 0 CATCH A]

TO TRY.IT :IN

PR "HELLO

:IN

END

? CATCH "ERROR [TRY.IT "A] SH ERROR

HELLO

[1 [I don't know what to do with A] TRY.IT 2 TRY.IT A]

  List of Error Messages


Basic Definitions - Definition List...
Definition List ...

is a valid Logo list specifying a everything in a Logo procedure - except its name. Its first member is a list containing the names of the procedure's inputs (without colons (:) before their names). If the procedure has no inputs, this list is empty. The following members of the list are lists representing lines in the definition of the procedure. END is never included in the definition list.

A definition list:

is an output of the TEXT operation,

can be used by the DEFINE command to define a Logo procedure,

can be used by Logo control procedures APPLY, FILTER, MAP and GENERATE.

If the definition list specifies a procedure with a variable number of inputs, its first member has the form [name [number ]], where name is the (only) input to the procedure and number is the default number of its inputs.


Basic Definitions - Demo Project...
Demo Project ...

is any Logo project saved as LGP file in the DEMO subdirectory. It must contain a user-defined procedure named STARTUP. If the demo project also contains an image variable ICON, its value is used as the project's icon in the Demo Projects Window. Otherwise, the default SuperLogo icon is used instead.


Basic Definitions - Expression...
Expression ...

is any valid Logo construction which can be evaluated, that is, outputs a value. Examples:

1000000	outputs a number 1000000,

"HELLO	outputs a word HELLO,

[A B C D E]	outputs a list [A B C D E],

:Var * 2	outputs the value of a variable Var times 2,

25 + 79	outputs a number 104,

SE "HI "THERE	outputs a list [HI THERE],

GETSHAPE	outputs an image, the shape of the first active turtle,

PENCOLOUR	outputs the colour of the first active turtle's pen


Basic Definitions - File Extension...
File Extension ...

is a string starting with a full stop and containing up to three characters at the end of a filename. It usually specifies the type of file. For example, Logo images saved in files have default extension .LGW, Logo projects have default extension .LGP, Logo programs saved as plain text have default extension .LGO, Logo problems have default extension .TXT, sound files have default extension .WAV etc.


Basic Definitions - File...
File Name ...

is a word that names a file. SuperLogo - and Windows in general - uses MS-DOS naming conventions.


Basic Definitions - Fill Pattern...
Fill Pattern ...

is an integer between 0 and 6, inclusive, denoting the following patterns:


Basic Definitions - Filter...
Filter ...

is a word following the MS-DOS conventions for specifying groups of files. Examples of filters are *.LGP, NEW??.\*, LOGO\*.LGW etc. However, because several characters have special meaning in SuperLogo, these filters must be specified as "LGP, "NEW??\\\*, "LOGO\\\*.LGW.

See why escape character \ should be used in filters

In specifying filters with path you can use a percent character (%) which denotes home directory.


Basic Definitions - Font...
Font ...

is a collection of all symbols, alphabet characters and numbers found in a particular graphic design. It usually comes in different sizes and styles. From technical point of view, all fonts are divided into bit fonts and vector fonts - for example TT, that is True Type fonts. Only vector fonts can be used by TTEXT  at angles other  than horizontal.


Basic Definitions - Global and Local Variable...
Global and Local Variables ...

Variables are either global or local. A variable is local to a procedure, if it is a name of that procedure's input or if it has been created in that procedure by LOCAL or LET and initialised by MAKE or NAME. Any local variable exists only while its procedure (i.e. procedure in which the variable has been created) is active.

If the variable is created by MAKE or NAME directly in the command line or from instructions in the command line and is not local to any active procedure at that time, then it is global.

Imagine a global variable VAR and, at same time, a user-defined procedure P in which VAR is also either the name of P's input or it is declared to be local inside the procedure by LOCAL (that is, VAR is both global and local with respect to P). Now, if procedure P is active and variable VAR is initialised in P, the original value of global variable VAR is temporarily replaced by the value of the local one - P doesn't "see" global VAR. When P finishes its instructions (that is, when it is not active any more), the original global variable VAR is restored.


Basic Definitions - Graphics Screen...
Graphics Screen ...

is the place where all turtles live and draw their graphics. That is, all commands addressing turtles are carried out here. You can also:

load any bitmap file and place it in the graphics screen,

place any image on the screen with PUTIMAGE  or get it from the screen with GETIMAGE,

make any turtle "stamp" its own shape with STAMP,

save any part of the graphics screen or its complete contents into a file or into the Clipboard,

make any active turtle print text onto the graphics screen with TTEXT,

make the first active turtle read a list with READLISTTURTLE operation.

The actual contents and settings of the graphics screen together with all existing turtles will become parts of your project when saved with Save Project. See also:

Resizing and Scrolling the Graphics Screen

Left Mouse Button

Right Mouse Button


Basic Definitions - Home Directory...
Home Directory ...

is a directory from where the SuperLogo application has been started. You can use a special character, the percent character % to refer to this directory. This convention makes it easier to specify Logo subdirectories and files. You can, for example, say:

? LOADLIB "%DEMO\\CUBE.LLB	to refer to a file in the Logo DEMO subdirectory

? EDFILE "%SLOGO.INI	to edit the SuperLogo initial file

The home directory can be redefined in Windows Command Line.


Basic Definitions - Home Position...
Turtle's Home Position ...

is a point in the graphics screen specified by the MAKETURTLE command at the time a turtle is created. When Logo starts, there's always the default turtle named 0 with its home position at [0 0] (unless you redefine it in SLOGO.INI). When the HOME command is used, each active turtle is moved to its home position.

Although the turtle's actual position can change all the time, the turtle remembers its home position and is moved to it whenever you use CLEARSCREEN.


Basic Definitions - Hot Spot of an Image...
Image Hot Spot...

is a point [X Y] specified for each frame of an image. This point is recognised by all Logo image commands as the reference point of the frame. For example, if a turtle is set to an image as its shape, the hot spot of the image (of the frame currently used) is identified by the turtle's position.

Note that:

each frame of an image has its own hot spot, see HOTSPOT,

the upper left corner of the frame is referred to as a point [0 0]. The X co-ordinate increases to the right, the Y co-ordinate increases downwards,

it is not necessary for the hot spot to be located inside the frame. If the size of a frame is, for example [50 35], it may well be [110 20] or [-25 -10] or [60 -10]. Both numbers must be between -255 and 255, inclusive.


Basic Definitions - ICON...
ICON ...

is a variable with an image value. Its first frame must be sized exactly 32 x 32 points and is used as an icon for the project which contains the variable.

The icon is used to show its project in the Demo Projects Window. If you want to use the icon to show its project when installed as a run-time application, the option Create .ICO file of the Options for Save Project dialogue must have been checked while the project have been being saved.


Basic Definitions - Image...
Image ...

is a valid data type in Logo. It is an empty or non empty series of frames, i.e. of bit maps which are stored in LGW files and used in projects. An image can be attached to any turtle as its shape. The following image is normally used as the basic (default) turtle shape:

Other turtles may look quite different:

Some more notes:

With SETFRAMEMODE you can change the way in which frames in a turtle's shape are used.

Images can be used as parts of drawings with PUTIMAGE (and others).

You can sometimes work with images in a similar way as you do with words and lists.

The maximum number of frames of an image is 250.

The maximum size of a frame is 255 x 255 points.


Basic Definitions - Input to a Procedure...
Input to a Procedure ...

is any type of data object valid in Logo. Examples are:

numbers 	55, -55, 0, 67.7777434,

images

words	JOE, TRUE, Welcome.to.Logoland

lists	[How are you], [ ], [A B [C D [E] F]

Be careful! In expression like PRINT DIFFERENCE 222 11, the input to PRINT is not the sub expression DIFFERENCE 222 11, but the number 211. Sub expressions are first evaluated - only then do their values become inputs to procedures. Here are some more examples of expressions and their values:

SUM 66 21 	evaluates to	87

COUNT "JIM	evaluates to	3

PEN	evaluates to	PU or PD, ... see PEN

Any number, image, word, list or output of an operation can serve as input to other operation or command - if it works as an output it will work as an input and vice-versa.


Basic Definitions - LGO File...
LGO File ...

is any text file containing definitions of Logo procedures, variables and properties or any valid Logo data.

LGO files can be processed with LOAD, SAVE, READFROM, PRINTTO and EDITFILE.


Basic Definitions - LGW File...
LGW File ...

is a special Logo file containing a Logo image. It can be processed by LOADIMAGE, SAVEIMAGE, MAKETURTLE, and SETMOUSECURSOR.


Basic Definitions - Library...
Library ...

is any valid Logo project, that is, any file with the correct LGP structure. However, the way that Logo processes libraries with the LOADLIBRARY command differs from the way it is processed when loaded with Open Project... in the File menu of the Memory Window.

Creating and Using a Library...

Libraries are developed and used by professional Logo programmers to structure a complex project into several parts that are incrementally or conditionally loaded when the project is being run.

Although a library has a standard LGP structure, it can have any extension you want, for example LLB or LIB etc. This rule helps you to distinguish libraries from other LGP files in the same directory.


Basic Definitions - List...
List ...

is a compound data structure composed of words, images and other lists. You can say that:

empty list [ ] is a list,

[s1 s2 ... sN] is a list, if each of its members is either a word, an image or a list.

You refer to number N as the COUNT of the list's members.


Basic Definitions - List of Button Definitions...
List of Button Definitions ...

is a list in the form [def1 def2 ... defN], where:

def1, def2, ... are button definitions,

the number of members of this list is between 0 and 30.

Buttons Window


Basic Definitions - List of Logo Instructions...
List of Logo Instructions ...

is a list in the form [instr1 instr2 ... instrN], where:

instr1, instr2, ... are Logo instructions,

the number of members of the list is either 0 or more.


Basic Definitions - List of Memory Objects...
List of Memory Objects ...

is a list in the form [mem1 mem2 ... memN], where each mem1, mem2, ... are user-defined memory objects.

See also Logo operations PROCS, NAMES and PROPS


Basic Definitions - List of Points...
List of Points ...

is a list in the form [p1 p2 ... pN], where p1, p2, ... are points.


Basic Definitions - List of Properties...
Property List ...

is a list in the form [atr1 val1 atr2 val2 ... ], where each pair atr1 val1 is a property. Property lists are output by PLIST and are used as inputs for SETPLIST.


Basic Definitions - List of Turtles...
List of Turtles ...

is an empty or non-empty list containing the names of currently existing turtles. Several Logo procedures like TELL and ERASETURTLE expect these lists as their input, other procedures like WHO, ALL or OVERLAPPED output lists of turtles as their result.


Basic Definitions - List of Words...
List of Words or Sentence ...

is a compound Logo structure of the form [word1  word2 ... wordN]. (If the list contains no words, it is called an empty list.)

A list of words in Logo is often called a sentence and is created from either words or other sentences with Logo primitive SENTENCE.

Several Logo procedures make use of lists of words as their input. For example, LOCAL gets a list of words and creates corresponding local variables.


Basic Definitions - Logical Value...
Logical Value ...

is either TRUE or FALSE. Logical values are used to express whether a certain condition is true. They are accepted, for example, as inputs by logical operators, and also by several control procedures like IF, TEST, AND etc.


Basic Definitions - Logo Instruction...
Logo Instruction ...

has one of the following forms:

command expr1 ... exprN     or

(command expr1 ... exprN)

where command is either a user-defined or primitive logo command and expr1, expr2, ... are expressions which will be evaluated by Logo and passed to the command as its inputs. The number of expressions depend on particular command.

Rules for Evaluating Inputs

Procedures with Variable Numbers of Inputs


Basic Definitions - Logo Procedure...
Logo Procedure ...

is the atomic building block of Logo programs. Each Logo procedure is a specialist in some particular task. CLEARSCREEN, for example, clears the whole graphics screen.

User-Defined Procedures

Logo Procedures Are Divided Into...

Inputs to a Procedure

Rules for Evaluating Inputs

Procedures with Variable Numbers of Inputs


Basic Definitions - Logo Subdirectory...
Logo Subdirectory ...

is any subdirectory of the Logo home directory. The following subdirectories are recognised by SuperLogo:

DEMO	- contains all demo projects,

IMAGE	- contains LGW files with images,

PROBLEM	- contains all Logo problems,

PROJECT	- contains LGP files with projects and LGO files containing data and programs,

WAVE	- contains WAV files with sounds,

SCREEN	- contains BMP files used as parts of the graphics screen. LOADSCREEN and SAVESCREEN use this subdirectory to search for the files. If the SCREEN subdirectory doesn't exist, Logo searches the IMAGE subdirectory instead.

See also SETPATH


Basic Definitions - Long Line...
Long Line ...

Logo requires that each instruction fits onto one line. This rule is rather restrictive when you are defining more complex procedures with several IF, REPEAT, MAKETURTLE etc. commands. To help with this, SuperLogo distinguishes between physical lines and logical lines: each instruction must fit into one logical line which may extend over several physical lines, that is, several lines of your procedure's definition. To let Logo know that these lines form one logical line, however, you have to place a tilde (~) special character at the end of each physical line which logically continues on the next line, see following example:

TO DECIDE :WHAT

IF AND  (FIRST :WHAT < 0) ~

(LAST :WHAT > 10) ~

    [ OP (FIRST :WHAT) + LAST :WHAT] ~

    [ OP (FIRST :WHAT) - LAST :WHAT]

END


Basic Definitions - Memory Object...
Memory Object ...

is a name of either a user-defined procedure or variable or word with defined properties. Note the way memory objects are referred to when their names serve as inputs to other procedures.

About PROCS, NAMES, and PROPS Lists...


Basic Definitions - Name of Procedure...
Name of Procedure ...

Word to be used as a name of your own procedure:

cannot be a number,

cannot contain any special character unless it is preceded by an escape character \,

cannot start with : or ",

cannot have any predefined meaning for Logo, for example be a Logo primitive.

It is quite useful to make names long enough to "say" what they mean in a program: DISTANCE is better than D.


Basic Definitions - Number...
Number ...

is a non-empty sequence of digits. It may start with plus (+) or minus (-) sign. It may also contain a decimal point or any decimal separator set in the Control Panel. This option may also be set directly in SuperLogo by SETLOGO with the DECIMAL input. Numbers may also be specified in scientific notation, where the exponent is limited to ±4932. The following are examples of legal numbers:

? SETFORMAT 18

? SH 100000/0.00007

1428571428,57142857

? SH -999999999 * 55555555555555555555555555555555555555

-5,55555555e46

A number may also be used as the name of a turtle or a variable. However, it cannot name a user-defined procedure.

See also SETFORMAT


Basic Definitions - Origin of the Graphics Screen...
Origin of the Graphics Screen ...

is the point [0 0] situated in the centre of the graphics screen.


Basic Definitions - Path...
Path ...

is a string which specifies the location of a file within the directory tree. For example, to specify the path of a file named CARS.LGW located in the SLOGO directory on drive D, you should type D:\SLOGO\CARS.LGW. However, as the \ character is a special character in Logo, you have to type D:\\SLOGO\\CARS.LGW. In specifying a path you can use a percent character (%) which denotes home directory.

Let's suppose that the work directory is D:\SLOGO\PROJECT. Then:

? SAVE "SQUARES.LGO PROCS

; saves all unburied procedures into the file

; named D:\SLOGO\PROJECT\SQUARES.LGO

? SAVE "FILES\\SQUARES PROCS

; saves all unburied procedures into the file

; D:\SLOGO\PROJECT\FILES\SQUARES.LGO

? SAVE "%DEMO\\SQUARES PROCS

; saves all unburied procedures in the directory DEMO,

; which is a sub directory of home directory %.


Basic Definitions - Pen Pattern...
Pen Pattern ...

There are five patterns available for a line. The default pattern is 0. To set or reset it, you use SETPATTERN. Patterns other than 0, however, are only effective if the turtle's pen width is 1.


Basic Definitions - Pen Width...
Pen Width ...

is any positive number, which is first truncated by Logo to be a positive integer (all numbers less than 0 are, however, increased to 1). Note that lines drawn by the pen width bigger that 5 have rounded ends.

? SETPW 0.2

? SH PW

1

? SETPW 2.4

? SH PW

2


Basic Definitions - Point...
Point ...

is a list in the form [X Y], where X and Y are numbers.

Points Represent Directed Line Segments ...

Points Can Also be Compared ...


Basic Definitions - Polygon List...
Polygon List ...

is a list with the structure:  [s1 s2 s3 s4 ... s2n-1 s2n ], where each pair of successive elements s1 s2; s3 s4, etc. is either

number  number       or

number  polygon_list

Examples of polygon lists are:

[ 100 90 ]

[ 100 90 100 90 100 90 100 90 ]

[ 4 [ 100 90] ]

[ 4 [ 100 -90 4 [ 20 90 ] 0 180 ] ]


Basic Definitions - Predicate or Conditional Procedure...
Predicate or Conditional Procedure

is any operation - either primitive or user-defined - which outputs TRUE or FALSE. Examples of such operations are numeric predicates <, >, <=, >=, <>, and =. Several Logo procedures expect one of their inputs to be TRUE or FALSE, like IF or TEST.

SuperLogo provides several operations which make it possible to combine simple conditions into more complex ones:

AND	- outputs TRUE, if all its inputs are TRUE; otherwise outputs FALSE,

OR	- outputs FALSE, if all its inputs are FALSE; otherwise outputs TRUE,

NOT	- outputs TRUE, if its input is FALSE; otherwise outputs FALSE.


Basic Definitions - Printer Flag...
Printer Flag ...

is an input which specifies the way printer settings are obtained. Its value must be one of the following:

[ ]	- printing will be to the default printer defined by the Windows' Control Panel with all its default settings. That is, no questions will be asked and no modifications of the actual settings of Logo printer are possible,

TRUE	- a dialogue opens before printing starts and asks for all printing options so that a user can choose everything in the same manner as if they used the Print command from the menu,

FALSE	- printing will occur at the printer which has been chosen most recently from Logo. All of the most recent settings are kept.


Basic Definitions - Problem...
Problem ...

is a .TXT file saved in the PROBLEM Logo sub directory. Through selecting Choose a Problem... in the Main Window (or by pressing F8 key) you open a list of titles of all problems. If you choose any of them, you get a Window with a Problem - an assignment to be solved in SuperLogo by a student. Each problem file can contain references to other .BMP files or .LGW files. Problem files can easily be created in SuperLogo itself. Thus, this feature allows a teacher or a parent to develop, store and distribute assignments to be presented later to their students.

  Window with a Problem to be Solved

  How to Produce Your Own Problems


Basic Definitions - Procedural Object...
Procedural Object ...

is either:

the name of a primitive or user-defined Logo procedure,

a definition list specifying the inputs and body of a procedure. For example [[A B] [FD :A RT :B]] specifies a binary procedural object,

a template, that is, a list in the form [ expression ]. If the template expects one input, it refers to it through a variable :%. For example: [ :% + 5 ], [ LIST "AAA :% ] are valid templates. If the template expects more than 1 input, it refers to them through variables named :%1, :%2, ... etc. For example: [ LIST :%2 :%1 ], [ IF :%1 > :%2 [ :%3 ] [ :%4 ]] are valid templates expecting two, res. 4 inputs.

Procedural objects are used to define the action to be taken on data by APPLY, FILTER, GENERATE and MAP.


Basic Definitions - Project...
Project ...

is the central concept of SuperLogo. To use Logo means either to use or to develop a project, that is, to "solve a problem" by creating our own turtles, by defining their behaviour in procedures and variables, by creating or importing the contents of the graphics screen etc.

More specifically, a project (saved in an .LGP file) is a complex structure preserving complete information about:

all turtles (that is, all facts concerning each existing turtle),

all user-defined objects (if you check this option while saving the project),

the complete state of the Main Window, that is, how the screen is divided between text and graphics screens, the actual contents of the graphics screen (if you check this option while saving the project), size of the graphics screen, its background colour, text colours, whether the Speed Bar is shown, whether the Buttons Window is shown or not and what the texts defined for its buttons are, whether the project has been saved with the Native Language Version on or off,

if there is an image variable ICON (of exactly 32 x 32 size) defined at the time of saving the project, its value is converted into an icon which is used as the project's icon in the Demo Projects Window.


Basic Definitions - Prompt...
Prompt or Text Prompt ...

is any word (empty or non empty) not longer than 16 characters which appears in the text screen whenever Logo expects you to type an instruction into the command line. The default text prompt is a question mark followed by a space. To change it use SETPROMPT.


Basic Definitions - Property...
Property ...

is a pair consisting of a name and a value, where name is any non empty word and value is any value. Any number of properties with different names can be associated with a word by PPROP and SETPLIST commands.

For the word ELEPHANT you can define following properties:

with name	and value

-----------------------------------------

 WEIGHT	3200	PPROP "ELEPHANT "WEIGHT 3200

 AGE	1.MONTH	PPROP  "ELEPHANT "AGE "1.MONTH

 NAME	JUMBO	PPROP  "ELEPHANT "NAME "JUMBO

All defined properties associated with a word form the property list of the word.

To find it, you use PLIST. The property list for ELEPHANT is now:

? SH PLIST "ELEPHANT

[WEIGHT 3200 AGE 1.MONTH NAME JUMBO]


Basic Definitions - Readlist Prompt...
Readlist Prompt ...

is any word - either empty or non empty - not longer than 16 characters, which appears in the text screen when Logo procedures READWORD and READLIST expect you to type in a word or a list. The default readlist prompt is a colon followed by a space. To change it you can use the SETRLPROMPT Logo primitive command.


Basic Definitions - Rectangle...
Rectangle ...

is a list of two or four numbers specifying a rectangular area in the graphics screen. It has one of the following forms:

[ ]

[X Y]

[X Y width height]

[X Y [X1 Y1] ]

[ [X Y] [X1 Y1] ]

where [X Y] specifies the upper left corner of the rectangle, width and height are positive or negative numbers (excluding 0) giving the width and height of the rectangle, [X1 Y1] gives the lower right corner of the rectangle. If you enter [ ], you are referring to the whole graphics screen. If you give [X Y], the lower right corner of the rectangle is identical with the lower right corner of the graphics screen.


Basic Definitions - Project Screen...
Project Screen...

is a bitmap graphic stored as an integral part of a Logo project. Any project may contain several screens (not necessarily of the same size): one of the screens is always referred to as the basic screen (or screen number 0) of a project, all others are referred to as additional screens.

Basic screen can be saved within the project only with the Save Project or Save Project As... dialogues, if you select its Options/Only Parts/Screen check box. Whenever you open the project (which contains the basic screen) through the Open Project dialogue, the basic screen is automatically displayed in the graphics screen, unless you deselect the Options/Only Parts/Screen check box. To refer to the basic screen of a project PROJECT.LGP at the Logo language level, you use either #PROJECT.LGP or #0PROJECT.LGP,

Additional screens can be stored within or displayed from a project - even if the project has no basic screen. You can do it with LOADSCREEN and SAVESCREEN (and their choosers), or with the Save Screen As... dialogue. All additional screens of a project are internally numbered with integers starting from 1 - showing the order in which they have been saved into the project. Therefore you can refer to them with #1PROJECT.LGP, #2PROJECT.LGP, ... etc.


Basic Definitions - Segment...
Segment of Items ...

is either:

a pair of integers [X Y], where X - a positive number - specifies which item of any word, list or image will be the first item of the segment and Y specifies how many items following the first one will form the segment. If Y is 0, the segment then refers to the empty segment (i.e. empty word, list or image). For example:

? SH ITEM [ 3 4] [A B C D E F G H]

[C D E F]

a list of such pairs [ [X1 Y1] [X2 Y2] ... ]. In this case the segment refers to a string of all partial segments [X1 Y1], [X2 Y2], ...


Basic Definitions - SLOGO.INI File...
SLOGO.INI File ...

is a text file located in the home directory (or in the directory specified in the Windows Command Line). It contains any number of valid Logo instructions that are run each time:

SuperLogo starts, or

ERALL is evaluated, or

you open a Logo project by choosing Open Project command (unless you check Add to Memory box in the Options for Open Project dialogue), or

you choose and start any demo project, or

you choose New Project.

It is not necessary to have an INI file at all. In that case no initialisation takes place when Logo starts. The name of the INI file must be identical to the name of the Logo EXE file. If you have a reason to rename the INI file, its name must be specified in the Windows Command Line.


Basic Definitions - STARTUP Procedure...
STARTUP Procedure ...

is a user-defined Logo procedure recognised and used by SuperLogo. If you have a STARTUP procedure in a project and open the project (or restart it by pressing Ctrl+F9) through the Open Project dialogue or by choosing it from the Demo Projects Window, this procedure is automatically run by Logo. This, however, doesn't happen if you turn off the Run STARTUP option in the Options for Open Project dialogue, or if you open the project by pressing Shift+F3.


Basic Definitions - Text...
Text ...

is either a word or a list of words. For example:

PETER

Julia

[Romeo & Julia]

are valid texts.


Basic Definitions - Text Screen...
Text Screen ...

is the place where you type in Logo instructions, and Logo responds with PRINT, SHOW, PRINTLINE and TYPE. This is where Logo prints all error messages (unless you select Options Menu Errors to Pop-Up Window). Here READLIST and READWORD echo their input lists and words typed in from the keyboard (unless you redirect the standard input stream to come from a file).

Typing Logo Instructions from the Keyboard

Right Mouse Button in the Text Screen

Defining Your Own Procedures

Inputs and Outputs of Logo Procedures

Command Line Editing Keys


Basic Definitions - Turtle Name...
Turtle Name ...

is any word used to name an object in the Logo graphics screen. Turtles can be created with MAKETURTLE and erased with ERASETURTLE. Each turtle has its own home position, basic heading, a shape, a pen, which is either on (down) or off (up). It also has several other attributes:

More on Turtles and Turtle Geometry


Basic Definitions - TXT File...
TXT File ...

is any file containing plain ASCII text. Although it is not necessary, its extension is usually .TXT. The contents of such a file is a sequence of lines of text. Logo makes use of plain text files for several purposes:

as its initial file SLOGO.INI,

as definitions of Logo problems,

as .LGO files containing Logo programs.

Text files can also be read or created (printed to) directly from a Logo program:

Printing To and Reading From a File


Basic Definitions - User-Defined Procedure...
User-Defined Procedure ...

is a Logo procedure defined by you (i.e. not a primitive procedure) either with TO,  EDIT  or directly in the Memory Window.


Basic Definitions - Variable Name...
Variable Name ...

is any non empty word. For example:

X

LENGTH

Z22

7Aaaa

44

FORWARD

-17

are valid names of variables.


Basic Definitions - WAV File...
WAV File ...

is any file containing a sound sequence encoded in a standard Windows WAV format - as recognised and processed by the Windows Sound Recorder. Although it is not necessary, its extension is usually .WAV. The contents of such a file has its own specific structure that can be played in Logo with PLAYWAVE.

More on Sounds and Multimedia


Basic Definitions - Windows Command Line...
Windows Command Line ...

is a string which specifies an EXE file (together with optional parameters) to be run to start an application. The Windows command line for SuperLogo contains the file name SLOGO.EXE with the complete path (which specifies the home directory) and may contain none or any of these parameters:

LGP file name - SuperLogo starts in its so called run-time version and immediately opens and runs the specified project. When the project is stopped, SuperLogo also stops,

/m - this application can be started even if SuperLogo is already running,

/ipath - where path redefines the home directory. This option makes it possible to have several SuperLogo directory structures with only one SLOGO.EXE file. In the directory specified by the path there may be a SLOGO.INI file,

/ipathINI_file_name - the same as above, however, the INI file explicitly named is run instead,

/iINI_file_name -doesn't redefine the home directory but specifies which INI file should be run when SuperLogo is started.

Use these options with care.


Basic Definitions - Word...
Word ...

is atomic Logo data structure. It is an empty or non-empty sequence of characters. It cannot contain any character with a special meaning to Logo, like a space, semicolon, +, <, \ etc., unless you insert the escape character \ before it. Examples: JOHN, peter, 23456, Me&Marry, Joe\ And\ Jim. If the word contains no characters, it is called an empty list.

You use words to name turtles, variables, properties, files etc. or you use them as a building material for Logo data structures - lists.

Words Can Also be Compared ...

More on Words


Basic Definitions - Work Directory...
Work Directory ...

is a directory which is searched by Logo to find any .LGP project, .BMP file or .LGO file when you want to load it with LOAD, LOADBITMAP, LOADLIBRARY or File Menu Open Project... and you specify no other path.

To change the work directory, use SETPATH with the "PROJECT input (or without any input). To find the actual work directory, use PATH with "PROJECT input (or without any input at all). The Work directory will be automatically updated by each Open Project... command, if you set AUTOPATH to 1 in SETLOGO.

If you do not specify any work directory in the SLOGO.INI file, Logo will start with the work directory set to the PROJECT subdirectory of the home directory.


Basic Definitions - Zzzzz...
Zzzzz ...

is the very last term of this Glossary. Unfortunately, it has no special meaning in SuperLogo except that it sounds like the snore of a tired SuperLogo programmer.


Words Can Also Be Compared ...

It is possible to compare words (other than numbers) as a whole, using the numeric predicates <, <=, >, >=, <>, =, EQUAL?, GREATER? and LESS?. To do so, Logo uses an "alphabetical" ordering - that is, each character in the first word (starting from the left) is compared with the corresponding character in the second word. The first unequal pair of characters determines the result.

It's like a dictionary; word1 will be "less than" word2 if and only if it is listed in the dictionary before word2.

? SH "HIM < "HIS
TRUE
? SH "METER < "METE
FALSE


Points Represent Directed Line Segments ...

Each point in the Logo graphics screen is represented by a pair [X Y ] of numbers. However, each point also represents a directed line segment, that is a vector - an "arrow" connecting the Origin of the graphics screen and the point [X Y ]. This vector (always in the Plane only) has magnitude and direction, an initial point and a terminal point.

In Logo programming you can make use of the fact that vectors can be added, multiplied by a number etc. Corresponding Logo Numeric Operations can therefore be applied to points-vectors as well.

? MAKE "POINT1 [20 -40]
? SH -:POINT1
[-20 40]
? SH 2 * :POINT1 - [35 25]
[5 -105]


Points Can Also Be Compared ...

In Logo programming it is sometimes useful to compare points, although in mathematics this concept is not well defined. In Logo we consider point [a b ] to be less than point [c d ] if and only if a is less than c and b is less than d. We say that [a b ] is less or equal to [c d ] if and only if a is less or equal to c and b is less or equal to d, etc.


Number of Decimal Places Displayed...
The Number of Decimal Places Displayed ...

This number is set with SETFORMAT and doesn't influence the precision of calculations, which is always the same. When Logo is started, SETFORMAT is defined as 2.

? PR 2 - 0.00001

2	; SETFORMAT is 2

? SH 2 * exp 1

5.44

? SETFORMAT 6	; let us make it 6

? SH ARCTAN -5

-78.690068

? SH 2 * exp 1

5.436564

? SH 3 / 7

0.428571


Priorities: The Order of Calculations ...

? SH (BL 123) + (BF 543)

55

? SH (BL 123) + BF 543

55

? SH BL 123 + BF 543

16

When evaluating (BL 123) + (BF 543) or (BL 123) + BF 543, Logo first computes BUTLAST of 123, which is 12, then BUTFIRST of 543, which is 43. Then these results are added by +. However, when you don't use brackets, 123 is first added to BF 543, which is 43. Then BL is evaluated giving the result 16. In general, + is evaluated before other operations like BF or BL. To change this order, you have to use brackets.


Priorities for Numeric Predicates...
The Order of Computations with Numeric Predicates ...

Let's compare the following examples:

? SH FIRST (21 < 26)

T

? SH FIRST 21 < 26	; because 1 = FIRST 21,

; it really is less than 26

TRUE

? SH AND 21 < 25 45 < 47

MESSAGE: 21 is neither TRUE nor FALSE

? SH AND (21 < 25) (45 < 47)

TRUE

The ERROR occurred, because Logo first evaluated 21 and treated it as the first input to AND. The same would happen if you type in SH AND (21 < 25) 45 < 47. Try to understand why...


Variables
  What are Variables?

Conceptually, a variable is a pair consisting of a name and a value. A variable's name:

is used to name a value stored in Logo memory,

can be any non empty correct Logo word.

A variable is created either with MAKE or NAME, or is created automatically (and temporarily) if it names an input (formal parameter) to any user-defined procedure or is locally created by LOCAL or LET inside a procedure. It can be erased with ERASE, or is erased automatically if it names an input to a procedure or has been created as a local variable and its procedure has just finished its computation.

The value of a variable can be used anytime without modifying it (unless we modify it on purpose). If what is a variable's name its value can be accessed either by THING "what operation, or directly by the name, which must be prefixed by a colon (:), as in :what. The colon is not part of the name, it only distinguishes the value of a variable from a Logo procedure with the same name.

A variable's value can be modified with MAKE or NAME. Its value can be any word, image or list.

    	Variables are Either Local or Global

SuperLogo provides some more procedures to work with variables:

      NAME?	- outputs TRUE, if there is a variable with a given name,

      NAMES	- outputs the list of all variables,

      ERASE	- erases one or more variables,

      EDIT	- makes it possible to edit (define or modify) the value of a variable,

      PO	- prints the names and values of specified variables.


How and Why You Bury Memory Objects
How and Why We Bury Memory Objects ...

In certain situations it is useful to hide (to "bury", to make invisible) some of the user defined memory objects so that:

they can be used as any other memory objects,

they are invisible to some Logo procedures, like SAVE, ERASE, PROCS etc.

The most common reason for working with buried objects is when you make use of Logo libraries. Buried objects are not displayed in the Memory Window (unless you select Show Also Buried on the Objects Menu, or type in the Logo instruction SETBURY "FALSE). To bury and unbury objects, you can either use BURY, UNBURY, BURYALL, and BURIED, or do the same by selecting the following commands of the Objects Menu of the Memory Window:

Bury

Unbury

Show Also Buried


How Buried Objects are Displayed and Processed
How Logo Displays and Processes Buried Objects ...

Buried objects can be made temporarily visible with SETBURY "FALSE or with Show Also Buried in the Objects menu of the Memory Window. Temporarily buried objects are still buried, but in several cases behave in a different way. When necessary, we will describe both situations. Buried objects:

can be used in Logo programs like any other user-defined memory objects,

will not be saved into the LGO file with SAVE  - unless they are first made temporarily visible,

will always be saved into a project by the Save Project command in the File menu of the Main Window - unless you manually turn off Save Also Buried in the Options sub-dialogue window of the Save Project dialogue,

will not be listed in the Memory Window - unless they are made temporarily visible,

cannot be edited with EDIT - unless they are made temporarily visible,

will not be printed onto the text screen by PO and POTS - unless they are made temporarily visible,

will be (!) erased by ERASE,

will be (!) erased by ERALL, because this command prepares Logo for starting completely new project.


Creating and Using Libraries
Creating and Using a Library ...

When a library is loaded into Logo by LOADLIBRARY, only turtles and memory objects (i.e. all user-defined procedures, variables and words with properties) saved in this file are loaded. That is, any Logo project file can be used as a library, however other information saved in it (like the contents of the graphics screen and other screen settings) are not loaded.

The actual list of turtles is extended with turtles loaded from the library. The actual list of all memory objects is extended by all memory objects from the library which are immediately buried.

A library is in fact any LGP project file, it can be created in two ways:

with Save Project As in the File Menu of the Main Window in the same way any other project is created,

with the SAVELIBRARY command directly from the Logo dialogue or from  any user-defined procedure. In this case only turtles with their settings and specified memory objects are saved into the library.


PROCS, NAMES, and PROPS Lists
How Do PROCS, NAMES, and PROPS Lists Look Like

Names of procedures in a PROCS list have no special sign as their prefix, like in [PROC1 PROC2 PROC3].

Names of variables in a NAMES list always start with a colon (:), like in [:VAR1 :VAR2 :VAR3].

Names of words with defined properties in a PROPS list always start with quotation mark ("), like in ["FATHER "MOTHER].

This rule is used to distinguish procedures from variables and words with defined properties, because any word can name all three of these objects at once; for example:

? MAKE "A 1000

? PPROP "A "AGE 25

? BURY [:A]	; is the same as BURY ":A

? ERASE ["A]	; is the same as BURY ""A

These lists are often used as inputs to commands like ERASE, PO, SAVE or BURY.


How to Use Different Frames of an Image
How to Use Frames of an Image

Any image can be used by a turtle as its shape, see SETSHAPE. There are two different methods used to display the turtle with its shape's frames:

the basic method makes use of frames to automatically show the current heading of the turtle. If there are, for example, 24 frames of the shape, each frame corresponds to 15 degrees heading,

an alternative method makes it possible to change frames at any time with SETFRAME and is mainly used for screen animation.

To change the method, use SETFRAMEMODE.

To change current frame in the SETFRAMEMODE "FALSE mode, use RIGHT, LEFT or SETHEADING. To change current frame in the SETFRAMEMODE "TRUE mode, use SETFRAME.

To find the currently displayed frame in both modes, use FRAME.


Escape Character \ and "Forbidden Words"

If you want to use a word containing one or more special characters normally used as delimiters, like [ or ", you have to use either CHAR with the corresponding ASCII code instead of each of these characters, or an escape character \ followed by the ASCII code of that character, or the escape character \ followed by a special character itself:

? SH (WORD "a CHAR 91 "c)

a[c

? SH "a\91c

a[c

? SH "a\[\ c

a[ c	; this is one word containing [ and a space

When using a filter to specify a group of files, there is an exception: if its first character is a wild card *, it doesn't need the escape character. All other occurrences of this character need it. For example, to specify *.* you have to write "*.\* or "\*.\* .


Printing to and Reading from a File
Printing To and Reading From a File...

To redirect standard output to go into a file:

? PRINTTO "TRY.TXT

? PR "THIS

? (PR "IS "ONLY "BEGINNING.)

? PR [VERY LONG LIST]

? SH [VERY LONG LIST]

? MAKE "PICTURE LOADIMAGE "%DEMO\\FROGS [ ]

? TYPE :PICTURE

? (TYPE 33 "\ 44)

? PRINTTO [ ]	; file is closed and output is redirected

; back to go to the text screen

The resulting file, TRY.TXT, now looks like this:

THIS

IS ONLY BEGINNING.

VERY LONG LIST

[VERY LONG LIST]

{image1}33 44

Now let's try to read this file with READCHAR, READWORD, and READLIST:

? READFROM "TRY.TXT

? SH RW	; is READWORD

; reads first word THIS

THIS

? PR RC	; is READCHAR

; reads one character from the second line

I

? PR RW

S	; rest of the word

? PR RW

ONLY

? SH READLIST	; rest of the line

[BEGINNING.]

? SH RL	; is READLIST

[VERY LONG LIST]

? SH RL

[[ VERY LONG LIST]]

? SH RW

{image7}33


Where to Use TEST, IFFALSE, and IFTRUE

TEST, IFFALSE and IFTRUE must occur in the same procedure, TEST must precede IFFALSE and IFTRUE.

It is not always necessary to use both IFTRUE and IFFALSE.

Both IFTRUE and IFFALSE can be used more than once in a procedure after one TEST command.

By using TEST, IFTRUE, and IFFALSE, long IF lines can be rearranged into a more readable form.


Logo Procedures are Divided into ...

commands and operations.

Commands are procedures which have certain effects, for example, print text on the screen, move a turtle, change any settings, quit Logo applications etc. Therefore when describing a command, we always say what its effect is.

Operations are procedures which calculate a value. Therefore when describing an operation, we always say what its value is. However, the result calculated in this way must be accepted and processed either by another operation as its input or by a command to for it to have an effect.

See also:

How to Define Your Own Procedures (in general)

How to Define Your Own Operations


  Choosers Are Divided Into ...

special choosers - these are specially designed dialogue boxes or tools like a ruler, a compass, Choose a Frame chooser etc.,

universal choosers - these open in the screen:

for (many) Logo primitive procedures which don't have their own special chooser,

for user-defined procedures expecting one or two inputs,

in situations when a special chooser cannot be opened (for example, if you type FD in the Object Editor, a simple universal dialogue opens instead of the ruler. The reason for this is that first active turtle may not have been set yet.)


  Universal Chooser

is a simple dialogue with four basic buttons Do it!, Write it!, Cancel and Help and one or two edit lines. The number of edit lines corresponds to the number of inputs required by the procedure for which you opened the chooser. This means that universal choosers do not open for procedures with other number of inputs. If a procedure accepts both 1 (or 2) inputs and also N inputs, it opens with 1 (or 2) edit lines.

The titles of the edit lines correspond to the names of inputs: If the procedure is your own, these names are identical to the names of inputs in the first line of the definition. If the procedure is a Logo primitive, these names try to give an idea of the types of expected input values.


  How to Open a Chooser

Each chooser belongs to a certain Logo procedure (sometimes to two or three of them) and can be opened in one of the following ways:

from the command line, if you type in the procedure's name (as the only word in the line) and press Enter (or F9),

from the command line, if you type an instruction or several instructions, and you do not set the input(s) for the last word on the line (this word must be a procedure's name) and press F9. If there is a chooser belonging to that procedure (either special or universal), it opens in the screen. If there isn't, the List of Commands Window opens in the screen instead,

from the Object Editor or File Editor whenever you press F9 after typing in a Logo procedure's name with a chooser. (Otherwise the List of Commands Window opens in the screen instead).

Depending on the way in which a chooser has been opened, some of its buttons will be disabled, see more about buttons in a chooser.

Some special choosers (when used from the command line) are small pop-up windows waiting until you click the mouse somewhere in the graphics screen. In this way, for example, you can set the input for the FORWARD chooser (a ruler), for the SETPOS chooser, set a rectangle for INSIDE? etc.


  Buttons in a Chooser

In most choosers there are four buttons:

Do it!

Write it!

Cancel

Help

Sometimes there may be some other buttons that are specific to a certain choosers, like Play it! in Play Wave or Directories... in Choose an Image.

The Do it! button is disabled if you open a chooser from the Object Editor. The Write it! button is disabled, if you open a chooser from the command line by pressing Enter.


Chooser - Number of Steps
  Number of Steps

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to FORWARD and BACK. The ruler appears in the graphics screen if you open the chooser from the command line. Otherwise, the universal chooser opens. To choose the number of steps, you click inside the ruler. The number of steps is also displayed in the small Number of Steps Window.


Chooser - Line Patterns
  Line Patterns

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETPATTERN.


Chooser - Colours
  Colours

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETBACKGROUND, SETFILLCOLOUR and SETPENCOLOUR. To choose a colour, you can either type its number into the text box, click a colour in the palette or create it by setting its R, G and B components.


Chooser - Colours (16 colours)
  Colours (16 colours only)

To learn more about the dialogue, click on it with the mouse

This chooser helps to set the input to SETSHAPECOLOUR. To choose a colour, you can either type its number into the text box or click a colour in the palette.


Chooser - Fill Patterns
  Fill Patterns

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETFILLPATTERN. To choose a fill pattern, you can either type its number into the text box or click a pattern in the pattern menu box.


Chooser - Pen Width
  Pen Width

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETPENWIDTH. To choose a pen width, you can either type its number into the text box or click a line in the pen width menu box.


Chooser - Coordinates
  Coordinates

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETPOS and SETXY. To choose a point in the graphics screen, you have to click there with the left mouse button.


Chooser - Rectangle
  Rectangle

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to INSIDE?, OUTSIDE?, GETIMAGE, WINDOW and WRAP. To set a rectangle with the form [X Y width height] in the graphics screen, you have to position the cursor in its upper left corner, then drag to its opposite lower right corner. To do this you can also use the Up, Left, Right and Down keys


Chooser - Choose a Frame
  Choose a Frame

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to SETFRAME. To choose a frame, you can either select it and press the Do it! or Write it! button, or you can double click it.


Chooser - Set Mouse Cursor
  Set Mouse Cursor

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to SETMOUSECURSOR. A slightly modified Choose an Image chooser opens. The mouse cursor must be a black and white (and transparent and reverse) image not bigger than 32 x 32 pixels. The Preview of this modified chooser shows it already reduced to match this colour and size.

Beside this, there is a check box called Test the Cursor in the chooser. If you check it, the mouse cursor is replaced by the current selection being made in the chooser. You can move it and click to see its second frame. The previous mouse cursor is restored when you click the check box again.


Chooser - Play Wave
  Play Wave

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to PLAYWAVE. It can also play any of the listed .WAV files.


Chooser - Load Screen
  Load Screen

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to LOADSCREEN. It also lets you preview any of the .BMP files listed in the list box or any basic screens of .LGP projects listed there.


Chooser - Save Screen As
  Save Screen As

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to SAVESCREEN command.


Chooser - Set Font
  Set Font

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the inputs to SETTTEXT command. It also provides a possibility to preview actually selected font.


Chooser - Line to Debug
  Line to Debug

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the list of Logo instructions, this is, the input to DEBUG command.


Chooser - Set Text Colour
  Set Text Colour

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the input to SETTC command.


Chooser - Write Text
  Write Text

To learn more about this chooser, click on it with the mouse.

This chooser helps to set the inputs to TTEXT command. It also provides a preview of actually selected text to be typed by each active turtle in actually selected font, size and style (of the first active turtle).


I belong to ...

  List of All Choosers


Buttons Window
  Buttons Window;   F10

Is a window containing either 15 or 30 buttons. For each button you can define its size, position within the Buttons Window, text or graphics (image) that will appear on it, and a behaviour (instructions) associated with the button, see about buttons definitions. In Logo language you do it by SETBUTTONS and BUTTONS procedures. You can also define the size and position of the whole window by SETBUTTONSSIZE command. To open or close the window you use SHOWBUTTONS and HIDEBUTTONS commands.

In Loge environment you can do following operations with the Buttons Window:

open or close it by pressing F10 function key,

move the whole window along the screen by dragging its title line,

move any button within the Buttons Window, if you press and hold Shift key and drag the button by the right mouse button,

define the button's size, position, text or graphics and its behaviour by clicking the button by the right mouse button.

 Dialogue: New Text for Button

When the non empty button is pressed, its behaviour (i.e. instruction or instructions associated with it) is automatically copied into the command line (as if it was typed in from the keyboard) and evaluated by Logo. It is also possible to recognise this situation by the READKEY operation. If you only want to copy the behaviour into the command line without evaluating it, you have to use # character as the first character of the behaviour. The complete definitions of all buttons are saved within a project.

  Speed Bar Button:

  Function Key:  F10


Dialog - New Text for Button
  New Text for Button

To learn more about the dialogue, click on it with the mouse.

It is a dialogue which opens if you click a button of the Buttons Window by the right mouse click (unless this feature is disabled be setting RIGHTCLICKS 0 in the SETLOGO command).


Dialog - New Text for Button
  New Text for Button

To learn more about the dialogue, click on it with the mouse.

It is a dialogue which opens if you click a button of the Buttons Window by the right mouse click (unless this feature is disabled be setting RIGHTCLICKS 0 in the SETLOGO command).


Text of a Button ...

is any text which will appear on the button. Its size is limited by the size of the button. For example, Move, MOVE IT!, go ahead are correct examples.

This text may also be directly an instruction or instructions to be evaluated whenever the button is pressed. In such case it is not necessary to specify also the Commands: edit line. For example, fd 40 rt 90, clearscreen, HOME or even FD without an input are correct texts. Last example - FD without the input will open corresponding chooser, when the button is pressed.


Commands:  ...

This line specifies what should happen when the button is pressed. It may be either a complete Logo instruction or even several instructions together with the expressions setting the inputs, or the incomplete instruction, that is, the name of a procedure which opens a chooser. For more details,

  See detailed description of button definition


OK Button ...

closes the dialogue and makes Logo accept all selections and settings done in it.

Other alternative: press Enter key on the keyboard.


Cancel Button ...

closes the dialogue without accepting any selections and settings done in it.

Other alternative: press Esc key on the keyboard.


Type of a Button ...

can be either textual, graphical or hidden.

If you choose Text, you will see four edit lines in which you can set the size and the position of the button.

If you choose Graphic, you will see two lines to set the button's position and two small windows to inspect the button's actual size and shape. As far as this type of button is not textual, the Text: edit line above is disabled now.

If you choose Hidden, you will see four edit lines to set the size and the position of the button. As far as this type of button is not textual, the Text: edit line above is disabled now.


Position of a Button ...

is specified by the X and Y co-ordinates of the button's upper left corner relative to the Buttons Window. The default position of the first (top most) button is [-1 -1].

If you set position which places the button completely out of the Buttons Window, you have to use SETBUTTONS command to get it back.


Two Images Associated with a Button ...

Two small inspection windows preview the actual shape associated with the button. The left one depicts the released button's shape, the right one depicts the pressed button's shape. If no image has been specified so far, both inspection windows are dark grey and the button is not defined.

The actual size of the button is specified by the size of the image associated with it.


Set Shape... Button...

opens the Choose an Image chooser. Here you can choose any image to become the button's new shape. If you choose an image with only one frame or you select only one frame from an image, both positions of a button will have the same shape. If you choose two frames, these will appear on the button when it is released and when it is pressed. If you choose more frames, only first two will be taken.

The actual size of the button will be specified be the size of the image chosen (by its smaller frame, if they are not the same).


Edit Shape... Button...

Opens the Image Editor with the actual shape (two frames) of the graphical button. You can modify the image there and, thus, change the actual button's shape.


Make Frame Button ...

Adds a button-like frames around both frames of the actual button's shape. The left one represents released button, the right one pressed button. The size of the button will fit the actual size of the button's shape.


List of Commands Window
   Commands List Window;   F9

It is a window containing a list of Logo primitive commands. This list can be defined by a teacher or a parent by SETLOGO command to facilitate using other procedures (especially by young users). Can be opened by pressing F9:

while typing Logo commands from a command line of the text screen, (see also on Choosers). Here you can highlight a command and press either Do it! button or Write it! button. When Do it! button is pressed, a special chooser belonging to the selected command opens (if it exists). Here you set the input(s) of the command and press Do it! button. When Write it! button is pressed instead, the selected command's name is typed into the command line. There you can set its input or inputs by typing them yourself,

while typing in the Object Editor. (Here you can open it by choosing Commands command as well.) You select a command name in the list of names and press either Inputs button or Write it! button. When Inputs button is pressed, a special chooser belonging to the selected command opens (if such chooser exists). Here you set the input or inputs of the command and press Write it! button - the command together with specified inputs is automatically written at the current text cursor location. When Write it! button is pressed, only the name of a command is written, so that you have to type its input or inputs yourself.

  Speed Bar Button:

  Function Key:  F9


Chooser - Make Turtle
  Make Turtle

To learn more about the dialogue, click on it with the mouse.

Corresponds to MAKETURTLE command. Opens Make Turtle dialogue box with several text boxes and options.


Chooser - Choose an Image
  Choose an Image

To learn more about this chooser, click on it with the mouse.

This chooser helps us to set input or inputs to Logo procedures LOADIMAGE, SETSHAPE and PUTIMAGE.


Chooser - Turn
  Turn Chooser

To learn more about the dialogue, click on it with the mouse.

This chooser helps to set the input to SETHEADING, LEFT and RIGHT commands. To choose an angle, you can either type the corresponding number into the text box or turn the red hand of the compass by the mouse.


Do it! Button

Converts all set information from the chooser into the Logo language instruction. It copies this text into the command line and adds the Enter key. That is, the Do it! button also makes Logo immediately act upon the complete Logo instruction typed in the command line. The chooser is immediately closed.


Write it! Button

Converts all set information from the chooser into the Logo language instruction. It copies this text into the line (either command line or a line in the Object Editor) from where you opened the chooser. The chooser is then closed. The instruction are not immediately acted upon, Logo waits for you to continue typing.


Cancel Button ...

If you opened the chooser by pressing the Enter key (that is, after typing the name of a procedure in the command line), the Cancel button will close the chooser and will also delete the name of a procedure from the command line.

If you opened the chooser by pressing F9, Cancel will only close the chooser (deleting nothing).

Alternatives: Esc or Alt+F4


Help Button ...

opens the page of this Help describing in detail all parts of the whole dialog. To find any detail, just click the list boxes, buttons and check boxes of the dialog with the mouse.


Chooser Control Menu ...

is a reduced standard control menu. It contains only two commands:

Move

Close     Alt+F4


Play it! Button ...

If you have a sound card installed in our computer (or SPEAKER.DRV) and you press this button, the selected .WAV file is played.


Directories Button ...

opens the list of directories and the list of drives. The Directories... button then becomes disabled. In the Drives drop down list you select the drive that contains the file you are looking for. In the Directories list you select the directory that contains your file by double clicking it. Above the Directories list, the selected path is shown.


Ruler ...

allows you to choose the proper number of steps within the range -200 to 200. The ruler always opens at the current position of the first active turtle, and has the same heading.


Number of Steps ...

is a small window displaying the number of steps from the turtles current position to the current mouse cursor position (if it is inside the ruler).


The Turtle ...

This is an example of the turtle. The ruler always opens in the same direction as the heading of the first active turtle.


Mouse Cursor ...

This is the shape of the mouse cursor until you choose another.


Line Pattern Number...

This is a text box which contains an integer between 0 and 4, , showing which line pattern an active turtle should use for drawing.

You can either type the number of line pattern here or choose one from the box below. In that case Logo automatically updates the number of the pattern in this box.


Line Patterns Menu...

Here you can click a pattern which you want for the turtle's pen. You can also choose it by pressing the Up or Down arrows.


Colour Number ...

Here you can either type or read the number of the selected colour.


Palette of 16 Basic Colors ...

This is the palette of 16 basic solid colors. To choose any of them, click it or select it by pressing the Up, Right, Left and Down arrows on the keyboard to move the selection frame.


Specifying RGB Colour ...

To set a colour as a list [R G B] of three integers, you can use these three horizontal scroll bars.


Colour Preview ...

In this box you can see how the selected colour looks. It depends considerably on the display and the graphic card driver.


Basic Colour Number...

Here you can either type or read the number of the selected basic solid colour, that is, an integer between 0 and 15.


Pen Width Number...

Here you can either type or read the number of the selected pen width. The number typed in here need not necessary be one of 1, 2, 3, 5, 7, 10 and 15, which are pen widths displayed in the pen width menu box bellow.


Pen Widths Menu...

Pen widths are displayed here: 1, 2, 3, 5, 7, 10 and 15. To choose any of them,  click it or select it by pressing the Up and Down arrows on the keyboard to move the selection icon.


Pen Width Preview ...

In this box you can see how the selected pen width looks. Notice that lines drawn with the pen width bigger that 5 have rounded ends.


Magnitude of the Angle ...

Here you can either type or read the magnitude of the selected angle.


Compass ...

Here you can set a turn to be taken by a turtle. The red hand of the compass can be either dragged from inside the dial or from outside. In this case only multiples of 45 degrees can be chosen.

When the chooser opens in the screen, the red hand of the compass shows:

the turtle's basic heading, if you have opened the chooser through Turtle: Change Me or through Make Turtle Chooser,

the turtle's actual heading, if you have opened the chooser through RIGHT or LEFT. However, the compass is adjusted here so that the current direction is marked 0 degrees. This is natural because you want to set an angle to be turned right or left from this heading,

turtle's actual heading, if you have opened the chooser through SETHEADING. However, 0 degrees is adjusted to the North in this case.


Fill Pattern Number...

Here you can either type or read the number of the selected fill pattern, that is, an integer between 0 and 6.


Fill Patterns Menu...

This is the menu of 7 basic fill patterns. To choose any of them, click it or select it by pressing Up, Right, Left and Down arrows on the keyboard to move the selection frame.


Coordinates of the Point ...

In this small window you see the current position of the mouse cursor within the graphics screen. Origin of the screen - the point [0 0] is located in the center of the graphics screen.


Mouse Cursor ...

This is the actual shape of the mouse cursor (sometimes called the pointer) until you set the point in the graphics screen by clicking it.


Four Numbers ...

set a rectangle of the form [X Y width height].


Clipping Rectangle ...

is the bordered area in the graphics screen specified by clicking its upper left corner and dragging the mouse cursor to its lower right corner.


Cross Hair Mouse Cursor ...

This is the shape of the mouse cursor until you set the rectangle in the graphics screen


List Box with All Frames ...

contains numbered frames of the shape of the first active turtle. You can select any of them - either by clicking the frame and pressing the button Do it! or Write it!, or by double clicking it.


First Input ...

is any correct Logo expression which outputs a value. Do not forget that this expression is first evaluated and only then its value is passed to the procedure as its first input.


Second Input ...

is any correct Logo expression which outputs a value. Do not forget that this expression is first evaluated and only then its value is passed to the procedure as its second input.


Image Chosen From ...

here you see whether the selected image comes from the .LGW file (from image library) or from Logo Memory.


From Image Library: ...

is a list box containing all images saved in specified directory. Each image you see here is the first frame of an image saved in the .LGW file. The name of a file (without the extension) appears beneath the image in the same frame. To see all frames of an image, click it and check the Preview check box below.


From Memory: ...

is a list box containing all image variables contained in the Logo Memory Window. Each image you see here is the first frame of an image value associated with the variable named beneath. To see all frames of an image, click it and check the Preview check box bellow.

Buried variables are not listed here, unless they are made temporarily visible with SETBURY or with Objects Menu Show Also Buried.


Preview Region ...

contains two check boxes: Preview and Select Frame and a list box. If you check Preview, all frames of the selected image are shown in the list box. The frames are numbered. If you also check the Select Frame box, you can restrict your selection to one or several frames of the image.


File Name and File Name List ...

Here you select or type the name of the file you want to open or save. This box lists all files with the filename extension selected in the List Files Of Type or Save File as Type box. To see a list of files with a particular extension, you can type an asterisk (*), a full stop, and the extension, and then press Enter. To see files with more than one filename extension, you can type a semicolon (;), a second asterisk (*), a full stop, and another extension. For example, if you want to see all files with the .BMP extension and all files with the .LGP extension, you will type *.bmp;*.lgp.


List Files of Type: ...

opens a drop-down list box with only one type: Wave Files (*.wav).


Directories and Drives...

Here you select the directory that contains the file you want to open. It is also possible to change the drive that contains the file you are looking for.


Font: ...

in this list box you choose which font should be used by all active turtles to type in the graphics screen with the Logo TTEXT command.

The actual contents of the list box, that is, the actual list of fonts depends on the Windows installation and can be modified by running the Control Panel/Fonts application.


Two Advanced Options ...

Fill the Background: if selected, each use of TTEXT will first fill the whole rectangle of text (as specified by TEXTSIZE operation) in the background colour, and only then type the text in this rectangle in the graphics screen,

Turtle on the Base Line: this option affects the relative position of the turtle and the text the turtle will type with TTEXT. If this box is selected, the turtle will be located on the same line as the resulting text itself. Otherwise, the turtle is located above the text.


Font Style: ...

Here you select a style of the selected font. Usually, you can choose here one of the following types: Regular, Italic, Bold and Bold Italic.


Size: ...

Here you can type or select a size. The sizes listed in the list box depend on the printer and the selected font. If the size you type is not available on the current printer, Windows chooses the closest available size.


Sample ...

Here you can inspect the effects of our choice.


Text Line ...

is a one line box in which you type the text you want all active turtles to type in the graphics screen. This text cannot contain Enter codes - it always goes into one line. The length of text is limited by the size of this box.


Text Preview ...

Here you see how the text set above would look if typed in the graphics screen by the first active turtle - in its correct font, size and style.


Name of the Turtle ...

in the text box here you set a new turtle's name, which may be any SuperLogo word. If a turtle with the same name already exists, it will be redefined. Logo will not allow you to close the window by creating a turtle without a name


Home Position ...   Xcor, Ycor text boxes:

These are two numbers X and Y setting a new turtle's home position. If the Make Turtle Chooser is opened through the List-of-Commands Chooser or by pressing F9, these numbers are always initially 0 and 0. If you open Make Turtle Chooser with the right mouse button shortcut menu in the graphics screen, X and Y listed in the dialog represent a point where the click took place. Both of these numbers can be modified in their text boxes.


Set Heading Button ...

opens the Turn Chooser, in which you set a new turtle's basic heading. This number is listed in the text box to the right of the button and can be modified.


Four Check Boxes ...

Here you choose the following settings:

Pen Down check box: if it is not checked, the new turtle's pen will be up,

Show Turtle check box: if it is not checked, the new turtle will be hidden,

Make Active check box: if it is not checked, the new turtle will not be included among active turtles,

Set Frame Mode check box: if checked, the turtle will not use the standard method for showing its heading through the corresponding frame, see SETFRAME.


Set Shape Button ...

opens the Choose an Image chooser, in which you select one of the displayed images (or part of it) as a new shape for the turtle. It is immediately displayed in the small preview box to the right of the Set Shape button.


Shape of the Turtle ...

This is a small preview window in which you see the first frame of the turtle's shape. If you double-click the window, the Image Editor opens with this image ready to be changed.

If the shape is identical to the basic (default) turtle's shape, the Editor is activated with no image opened to be changed.


Number Code ...

Here you can type or read the number of text screen colours selected in both palettes. It is an integer number of the form 16*X + Y (both X and Y are integers between 0 and 15, inclusive), where X indicates selected colour of the text screen background and Y indicates selected colour of the text itself.


Palette For Text ...

This is the palette of 16 basic solid colours from where you can choose one for the text in the text screen. To choose any colour, click it or select it by pressing the Up, Right, Left and Down arrows on the keyboard to move the selection frame.


Text Screen Preview ...

This box shows the selected text screen colours.


Palette For Background ...

This is the palette of 16 basic solid colours from where you can choose one for the background of the text screen. To choose any colour, click it or select it by pressing the Up, Right, Left and Down arrows on the keyboard to move the selection frame.


Instruction/Instructions Text Box ...

Here you type one or more Logo instructions to be debugged.


Save File as Type: ...

SuperLogo can save screens in two different formats: either as a .BMP file or as a part of a .LGP Logo project. If you choose the Logo Project Files (*.lgp) option, you can save the screen into a specified Logo project as its additional screen, not the basic one.

  See also SAVESCREEN


List Files of Type: ...

opens a drop-down list box with two alternatives: Bitmap Files (*.BMP) and Logo Project Files (*.LGP). Note that through this selection it is possible to load the basic screen saved within a LGP Logo project.


Screen Preview ...

If you select the Preview check box, and any .BMP file or .LGP file (which contains a screen) is selected, a preview of the screen is displayed here.


Preview of the Cursor ...

contains two check boxes: Preview and Select Frame and a list box. If you check Preview, all frames of the selected image are depicted in the list box, however they are first reduced to black and white (and transparent and reverse) colours and to a size not bigger that 32 x 32 pixels.

If you also check the Select Frame box, you can restrict your selection to one or several frames of the image. If you select one frame, it will be used for the mouse cursor in the graphics screen. If you choose more frames, only the first two will be accepted. The second frame will be the mouse when its left button is pressed.


Delete
  Delete;   Del

Deletes all objects selected in the list of objects.

Before the object or objects are deleted, a warning message opens in the screen waiting for confirmation.

Function Key: Del

Logo Language: ERASE


I belong to ...

  Objects Menu in Memory


Add Procedure...
  Add Procedure...;    Ctrl+P

Creates a new user-defined procedure. A dialogue box opens on the screen asking for the name of the new procedure. The name must be different from all Logo primitive procedures and from all currently existing user-defined procedures. After you type it in and press the OK button, the following things happen:

new object with [image] icon appears in the List of Objects,

new inspection window opens. It contains only a heading line and the end line,

Edit command is automatically selected for this object, so that the Object Editor opens and is ready for creating a new procedure.

To close the Object Editor, you have to either double-click the Editor's control menu icon, press F12, or select End Editing command.

Shortcut Key: Ctrl+P

Logo Language: EDIT or TO


Add Variable...
  Add Variable...;   Ctrl+R

Creates a new user-defined variable. A dialogue box opens asking you for the name of the new variable and its type, which may be either Text or Image. The name may be any valid name of a variable different from all other variables in the List of Objects. When you type it in, select the type of a new variable and press the OK button, the following things happen:

new object with [image] icon appears in the List of Objects,

new empty inspection window opens with the name of new variable in its title bar,

Edit command is automatically selected for this object, so that either the Object Editor opens, if the variable's type is Text, or the Image Editor opens, if the variable's type is Image. In both cases, the editor is ready for defining the value of a variable.

--------------------------------------------------------

Shortcut Key: Ctrl+R

Logo Language: EDIT or MAKE and NAME (only for Text variables)


Add Property...
  Add Property...;   Ctrl+Y

Defines new properties for a word. A dialogue box opens asking you for the word and properties - this word must have no properties defined so far. When you type it in and press the OK button, the following things happen:

new object with [image] icon appears in the List of Objects,

new empty inspection window opens with this word in its title bar,

Edit command is automatically selected for this object, so that the Object Editor opens and is ready for defining the properties.

To close the Object Editor, you have to either double-click the Editor's control menu icon, press F12, or select the End Editing command.

Shortcut Key: Ctrl+Y

Logo Language: EDIT, PPROP and SETPLIST


Open Object
  Open Object;   Enter

If an object is selected in the List of Objects and you choose Open Object, the object's inspection window opens in the Inspection Area of the Memory Window. If more objects are selected, the same is done for all of them. When the object's inspection window opens, a small light in its icon in the List of Objects turns yellow: , [image] or [image].

Shortcut Key: Enter

Mouse Shortcut: double-click the object and it opens


Close Object
  Close Object;   Ctrl+Enter

All selected inspection windows are closed, that is, they disappear from the Inspection Area of the Memory Window. (However, they continue to be displayed in the List of Objects as closing them doesn't mean deleting them!)

When the object's inspection window is closed, a small light in its icon in the List of Objects turns grey: , [image] or [image].

Shortcut Key: Ctrl+Enter

Mouse Shortcut: double-click the object's name in the List of Objects or click the icon in the title bar of the inspection window


  Close All

All inspection windows are closed, that is, they disappear from the Inspection Area of the Memory Window. (However, they continue to be displayed in the List of Objects as closing them doesn't mean deleting them!)

When the object's inspection window is closed, a small light in its icon in the List of Objects turns grey: , [image] or [image].


I belong to ...

  Memory Window


Edit
  Edit;   F11

Opens the Image Editor (if the object to be edited is an image variable) or the Object Editor (if the object is a text variable, a procedure, or a word with defined properties). Within the editor you can modify the object, that is, you can either modify its image value, its list or word value, its definition, or its property list. When the object is going to be edited, small light in its icon in the List of Objects turns red: , [image] or [image].

To finish editing and return to the object's inspection window (if it is open) with the updated contents, you can press F12 or close the Editor Window.

However, Edit is disabled any time there is more than 1 object selected in the List of Objects.

Function Key: F11

Mouse Shortcut: double-click the working area of the inspection window (if it is open)


End Editing
  End Editing;   F12

Finishes editing the object, closes the Editor Window and opens the object's inspection window with updated contents (even if you have used Edit without first opening the inspection window).

If the edited object is a procedure, its structure is checked first to see if it is correct, see also:

Parts of the Procedure's Definition

If the structure is not correct, an error message is displayed and you are not allowed to finish editing the object until you fix it.

Editing can be also ended by selecting Edit for another object. A message in a pop-up window asks whether you want to save previous changes or not.

Shortcut Key: F12

Mouse Shortcut:  click the minimisation icon of the Editor, or use any other standard way to close the window.


  Bury

This command allows you to bury all selected objects of the List of Objects so that they are not displayed among other objects until you either unbury them permanently with Unbury or temporarily with Show Also Buried.

See also:

How and Why You Bury Memory Objects...

------------------------------------------------------------

Logo Language: BURY


  Unbury

Allows us to permanently unbury some of the objects buried with Bury. All objects unburied in this way will be displayed in the List of Objects.

All currently selected objects will be unburied. However, to select any of buried objects, you must first temporarily unbury all of them with Show Also Buried, then select and unbury those objects that you want to, and deselect Show Also Buried (that is, turn it off).

See also:

How and Why You Bury Memory Objects...

---------------------------------------------------------

Logo Language: UNBURY


  Show Also Buried

Temporarily shows also all buried objects in the List of Objects, so that they can be saved to a file, erased, inspected in their inspection windows, edited etc., and also unburied permanently by Unbury.

If Show Also Buried has not been selected (or was deselected), buried objects are not listed in the List of Objects.

See also:

How and Why You Bury Memory Objects...

----------------------------------------------------------

Logo Language: SETBURY


  Open Below Others

When this option is checked, each selected user-defined object will always open bellow all other inspection windows already open in the inspection area. This option will be turned off if you select Open on the Top.


I belong to ...

  Options Menu in Memory


  Open on the Top

When this option is checked, each selected user-defined object will always open in the inspection area at its very top (possibly partly or completely covering other inspection windows). This option will be turned off if you select Open below Others.


New (in the Memory Window)
  New

If there are any user-defined objects in the Memory, this command brings up a warning box asking: "Do you want to erase everything in the Memory?" If you choose Yes, all objects in the Memory are erased, both graphics screen and text screen are cleared and Logo resets as if it were started afresh - it is ready to start a new project.

Logo Language: ERALL


I belong to ...

  File Menu in Memory


Open... (in the Memory Window)
  Open...

Opens a library chosen in the Open Project dialogue box, that is, for reading user-defined objects and turtles saved previously in a project either with SAVELIBRARY or Save Project As... from the Main Window File Menu (without the contents of the graphics screen), or with Save Selected Objects As... from the Memory Window.

The same Open Project dialogue box opens as with Open Project.... However you will see some minor differences in the Options for Open Project dialogue box if you press the Options... button:

Complete Project - is disabled and not checked,

Screen - is disabled and not checked,

Bury Them - is not checked (but you can change it),

Add to Memory (no erase) - is disabled and checked, that is, no objects in the Memory Window can be erased with this command,

Run STARTUP - is disabled and not checked.

Logo Language: LOADLIBRARY


  Save Selected Objects As...

Saves all currently selected user-defined objects from the Memory Window into a library. Unlike Save Project As... in the Main Window File Menu, Save Selected Objects As... can save neither the contents of the screen nor any turtles.

Opens the Save Selected Objects As... dialogue box with the following options:

Project Name - Here you set the file to save a project in it. You can either type the name in the Project Name text box, or use the current name, or select a name in the list box of projects,

Save File As Type - Currently lists only Logo Project Files (lgp.*) type, i.e. .LGP extension and Logo Program File (*.lgo),

Drives - Here you select the drive in which Logo will store the project that you want to save,

Directories - Here you select the directory in which Logo will store the project that you want to save. The directory displayed initially is the work directory.

If you press the OK button or Enter key when there is a project name typed in the Project Name text box, all selected objects will be saved.

Logo Language: SAVELIBRARY


  Print Objects...

Allows you to print the contents of any objects from the Memory Window. Opens the Print Objects from the Memory Window dialogue with the following options:

Which Objects - here you chose Procedures, Variables and Properties,

Range - either all objects or only those that are currently selected in the List of Objects,

Print to File, Printer, Number of Copies, Resolution - have standard Windows meanings,

Collate Copies - will print copies organised in page number order,

Titles & Icons - will print a title line for each printed object together with its name and icon,

Options Button - opens Print Setup dialogue box in which you set the Orientation, Printer, Size of Paper, and more Options (specifying Dithering, that is, the way graphics will be printed, Intensity Control, that is, the darkness and fineness of graphics and text, and Print True Type as Graphics option),

Margins Button - specifies Top, Bottom, Left, and Right margins of a printed page, plus Measurement Units (in centimetres or inches)


Close Memory
  Close Memory;   F4, Ctrl+F4, Alt+F4

Closes the Memory Window.

Shortcut Key: F4, Ctrl+F4, Alt+F4

Mouse Shortcut: Double-click the control menu icon of the Memory Window.


Next Window
  Next Window;   Ctrl+F6

Sometimes you have more than one window open within SuperLogo at the same time, for example Memory Window, one or even more Windows with Problems to be solved, File Editor Window etc. The Next Window command lets you switch from one to the other - in this way it helps to organise all windows in the Logo Main Window.

Memory Window is always the first one to be switched to after selecting Next Window (if it is actually shown).

Function Key: 	Ctrl+F6


  Inspection Window

This is a window which displays the contents of an object, that is:

an image with all its frames, if the object is an image variable,

a word or a list, if the object is a Text variable,

a procedure definition, if the object is a procedure,

a property list, if the object is a word with defined properties.

The inspection window is only for inspecting object's contents. If you want to modify it, you have to open it. There are several alternative ways to close it afterwards.


I belong to ...

  Inspection Area in the Memory Window


  File Menu Commands (in the Memory Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

Commands in this menu allow you to erase all objects from the Logo Memory, open a project (or a library), create a library by saving selected objects into a file, etc.


  Edit Menu Commands (in the Memory Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

Commands in this menu allow you to make use of the Windows Clipboard to cut, copy or paste user-defined memory objects.


Objects Menu Commands
  Objects Menu Commands (in the Memory Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Objects Menu Commands

Commands in this menu allow you to create new objects, to inspect and modify them in the Object Editor, and bury or unbury them. You must know how to navigate through the list of objects and how to select them.


Options Menu Commands
  Options Menu Commands (in the Memory Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Objects Menu Commands

  Options Menu Commands

With commands in this menu you set the place in the inspection area where selected objects will open.


Cut (in the Memory Window)
  Cut;   Ctrl+X

This command allows you to remove all objects  selected in the list of objects from the Memory Window (and thus, from Logo memory) and put them onto the Clipboard. Objects can be pasted back to this project or moved to another Logo project or library.

The object or objects currently on the Clipboard will be kept there until you cut or copy another object, text or graphic.

The command is unavailable if you have no object selected.

Shortcut keys: Ctrl+X


Copy (in the Memory Window)
  Copy;   Ctrl+C

This command allows you to copy all objects  selected in the list of objects in the Memory Window onto the Clipboard. The contents of the Clipboard can be pasted back to this project or moved to another Logo project or library.

The object or objects currently on the Clipboard will be kept there until you cut or copy another object, text or graphic.

The command is unavailable if you have no object selected.

Shortcut keys: Ctrl+C


Paste (in the Memory Window)
  Paste;   Ctrl+V

This command allows us to paste back into Logo memory (and thus, also into Logo Memory Window) a copy of an object or objects stored on the Clipboard. You can do this even if the Memory Window is currently closed. In this case the object or objects are created by pasting their definitions (through MAKE, TO or PPROP) into the command line of the text screen.

The Paste command is unavailable if the Clipboard is currently empty.

Shortcut keys: Ctrl+V


I belong to ...

  On Edit Menu in Memory


  List of Objects

  Parts of the Memory Window

  List of Objects

It displays the names of all user-defined objects which have either been:

loaded into Logo memory by opening a project, a library, or an LGO file,

created by running a Logo program or Logo instruction from the command line, see MAKE, PPROP, TO, DEFINE, EDIT and SETPLIST,

created within the Memory Window with commands of the Objects Menu.

All names in the list are sorted by their type (procedures, variables, properties) and within the group listed alphabetically. If there is a procedure named STARTUP in Logo memory, it is listed as the first object of the list. Each name is accompanied by an icon specifying the object's type:  for procedures, [image] for variables and [image] for words with defined properties. Note that there may be two objects with identical names and of different types: for example, procedure F111 and variable F111. A small light to the right of the icon is yellow, [image] if its object is actually open in the inspection area as a separate inspection window. The light is red, [image] if the object is currently being edited either in the Object (text) Editor or in the Image Editor. Otherwise the light is grey.

  How to Navigate through the List of Objects

  Selecting Objects

  What You Can Do with Selected Objects

  Creating Text Box Turtles in the Memory Window


  How to Navigate Through the List of Objects

A dotted rectangle which you see in the List of Objects is called the selection cursor. You can move it through the List of Objects:

with the mouse: click on any object in the list and the selection cursor will move here,

if the List is too long to fit into one screen, a scroll bar appears on its right side. With the mouse you can scroll through it and click on any of the objects,

Up arrow: moves the selection cursor up one object,

Down arrow: moves it down one object,

Page Up: moves it up by one screen,

Page Down: moves it down by one screen,

Home: moves it to the first object,

End: moves it to the last object,

any letter: the selection cursor jumps to the next object beginning with this letter.


  Selecting Objects

In the List of Objects you can select an object or several objects and apply a command to them from the main menu of the Memory Window. Selected objects are highlighted. You can do it in several ways:

A. Using the keyboard:

if you want to select a continuous group of objects, you can move the selection cursor until you highlight the first object in the group. Then you hold down the Shift key while pressing the arrow keys until you move to the last object in the group,

if you want to select any group of objects, you have to move the selection cursor until you highlight one object of the group, then you press Shift+F8 - this will cause the selection cursor to blink. Then you use arrows or other shortcut keys to move the selection cursor to the next item in the group. There press Spacebar to select the object. You repeat this procedure until all objects in the group are highlighted. Then you press Shift+F8 once more to finish selecting.

B. Using the mouse:

to select it, you simply click the object,

if you want to select a continuous group of objects, you click on the first object in the group, hold down the Shift key, and click on the last object in the group (or the reverse),

if you want to select objects that are not in consecutive order, you click one of them, then press and hold down the Ctrl key while clicking each object in the group. (If you select a wrong object, you click it once more - while still pressing down Ctrl key.)


  What Can You Do with Selected Objects

You can apply different commands to a selected object (or selected objects) in the List of Objects:

Open Object's Inspection Window

Close Object's Inspection Window

Edit an Object

Delete an Object / Objects

Create a New Procedure, Variable, or Property


Open Object's Inspection Window...

means open an object's inspection window  in the inspection area of the Memory Window. The inspection window contains either the object's value - if it is a variable, its definition - if it is a procedure, or its property list - if it is a word with defined properties. When the object's inspection window is open, a small light in its icon in the List of Objects turns yellow: , [image] or [image].

Menu command: Open Object

Mouse Shortcut: double-click the object in the List of Objects,

Shortcut Key: Enter


Close Object's Inspection Window...

means close the object's inspection window so that it disappears from the inspection area of the Memory Window. When it is closed, a small light in its icon in the List of Objects turns grey: , [image] or [image].

Menu command: Close Object

Mouse Shortcut: double-click the object's name in the List of Objects,

Mouse Shortcut: click the icon in the inspection window's title bar

Shortcut Key: Ctrl+Enter


Edit an Object...

means to edit the value of the object (for variables), its definition (for procedures), or its property list (for words with properties). You can do it either in the Image Editor if the object is an image variable, or in the Object Editor in all other cases. When the object is being edited, a small light in its icon in the List of Objects is red: , [image] or [image].

Menu command: Edit,

Mouse Shortcut:  double-click the working area of the inspection window if it is currently open,

Shortcut Key:  F11 in the Memory Window if one object is selected

To finish editing and return to the object's inspection window (if it is open) with updated contents, you have to press F12 or close the Editor Window.


Delete an Object / Objects...

means delete selected object / objects from the List of Objects and thus from the Logo memory.

Menu command: Delete

Shortcut Key: Del


Create New Procedure, Variable, or Property...

you either press Ctrl+P, Ctrl+R, or Ctrl+Y, or apply any of the following commands of the Objects Menu:

Add Procedure...

Add Variable...

Add Property...


  Inspection Area

  Parts of the Memory Window

  List of Objects

  Inspection Area

The Memory Window is a split window with a vertical dividing line which divides it in the List of Objects on the left and the Inspection Area at the right. The dividing line can be dragged with the left mouse button. However, the List of Objects can't be minimised so that it completely disappears from the screen.

The Inspection Area itself is either empty (if no object is actually open), or contains objects' inspection windows. These can be dragged with mouse along the Inspection Area, closed with Close Object or turned into either the Image Editor or Object (text) Editor.

To set the way the inspection windows will be placed in the Inspection Area, select either Open Below Others or Open on the Top in the Options menu.

If there are more inspection windows open than the Inspection Area can display at once, scroll bars appear along the right-hand side of the window and / or at the bottom.

If there are many inspection windows open at the same time, locating any of them can be difficult. To make things clearer, click the object's name in the List of Objects - the contents of the Inspection Area is moved automatically so that the object's inspection window is visible.

  Creating Text Box Turtles in the Memory Window


I belong to ...

  On List of Objects in the Memory Window


About the Buttons...

There are three useful buttons in the speedbar of the SuperLogo Help Example Window:

closes the SuperLogo Help Example Window and returns to the Main Help Window,

copies the complete contents of the window onto the Clipboard, so that you can easily switch to SuperLogo and paste the contents into the text screen with Ctrl+V. The text copied from the Help Example Window is then run so that you can see its effect on the screen. BE CAREFUL: some examples may modify your turtles and screen (by clearing it, for example). Therefore, it is recommended that you save your project in SuperLogo before you use this button and run an example.

prints the contents of the window to the printer, if you have a printer properly installed in Windows and ready for printing.


; RANDOM WALK - Procedures ABS,

; HOME, XCOR, YCOR and RANDOM

;

; You will create a turtle named "WALKER. It will randomly

; walk around the origin. However, as soon as it moves

; away from that point too much, Logo will bring it back home.

; Let WALKER walk and walk and walk - until it draws a ... what?

;

? MAKETURTLE "Walker [0 0 0]	; [0 0 0] can be replaced by [ ]

? TELL "WALKER

? SHOWTURTLE

TO WALK

RT RANDOM 360

FD 5

IF ABS XCOR > 60 [HOME]

IF ABS YCOR > 60 [HOME]

WALK

END

? CS GS

? WALK


; RANDOM WALK, Second Version - Procedures ABS,

; HOME, XCOR and YCOR

;

; Again you will create a turtle named "WALKER.

; This time, however, you will not use the tests of the form

; 	IF ABS XCOR > 60 ....

; Instead, you will check the distance of actual WALKER's

; position from the origin. Let WALKER walk and walk

; and walk. Will the result be the same?

;

? MAKETURTLE "Walker [0 0 0]	; [0 0 0] can be replaced by [ ]

? TELL "WALKER

? SHOWTURTLE

TO WALK2

RT RANDOM 360

FD 5

IF ABS POS > 60 [HOME]

WALK2

END

? WALK2


; JUMPING WITHIN THE GRID

; Procedures DIV, SETPOS, READKEY, MOUSE and  DOT

;

; You will create a turtle named JUMPER. You define a variable

; GRID that specifies a virtual grid of points - distances of two

; adjacent points along X axis and along Y axis will always be

; :GRID. You define a procedure SNAP.TO.GRID with the

; following aim: wherever you click mouse on the graphics

; screen, JUMPER will jump to the point that is one of the four

; nearest grid points and will draw a point there:

;

? MAKETURTLE "JUMPER [0 0 0]

? TELL "JUMPER

? SHOWTURTLE

? SETPC 12

? SETPW 6

? PU

? MAKE "GRID 30

TO SNAP.TO.GRID

TEST READKEY = -2

IFT [SETPOS :GRID * DIV MOUSE :GRID]

IFT [PD DOT PU]

SNAP.TO.GRID

END

? SNAP.TO.GRID


; EUCLID'S GCD ALGORITHM

; Procedures MOD and OUTPUT

;

; This is a very quick and clever program for finding the

; Greatest Common Divisor of two input integers:

;

TO EUCLID :NUM1 :NUM2

IF :NUM2 = 0 [OP :NUM1]

OP EUCLID :NUM2 MOD :NUM1 :NUM2

END

? SHOW EUCLID 12 8

? SHOW EUCLID 8 12

? SHOW EUCLID  1234563456 7659


; RANDOM WALK 3 - Procedures DIFFERENCE,

; ABS, XCOR, <> and POS

;

; First you define two points, Point1 and Point2. Then you

; create a turtle named "WALKER. It will walk at random,

; however both points will try to push it away from their position.

;

? MAKE "POINT1 [-100 0]

? MAKE "POINT2 [100 0]

? MAKETURTLE "WALKER [ ]

? TELL "WALKER

? ST

TO TRY

RT RANDOM 360

FD 10

IF ABS DIFFERENCE POS :POINT1 <> ~

    ABS DIFFERENCE POS :POINT2 [SETX 0]

TRY

END

? TRY


; MAGNIFICATION WITH A SECOND TURTLE

; Procedures or PRODUCT, ASK, READKEY,

; and SETPOS

;

; First you create a turtle named "JOE1. Procedure MAGNIFY will

; get a number - a ratio of magnification. Based on this number, it

; will create the second turtle "JOE2 and will position it in the corresponding

; point - worked out by PRODUCT :ratio ASK "JOE1 [POS]. Then

; MAGNIFY will run MAGNIFY1, that will start ordinary

; "free hand drawing" with the mouse with JOE1. JOE2 will copy the

; movements, but magnified (or reduced) by the given ratio:

;

? MAKETURTLE "JOE1 [200 0 0]

? ASK "JOE1 [ST]

TO MAGNIFY :Ratio

MAKETURTLE "JOE2 :RATIO * ASK "JOE1 [POS]

ASK "JOE2 [WINDOW ST]

MAGNIFY1 READKEY

END

TO MAGNIFY1 :IN

IF :IN = 0 [ASK "JOE1 [SETPOS MOUSE] ~

    ASK "JOE2 [SETPOS :Ratio * ASK "JOE1 [POS] ] ~

 	    ASK [JOE1 JOE2] [PD] ]

IF :IN = -1 [ASK "JOE1 [SETPOS MOUSE] ~

     ASK "JOE2 [SETPOS :Ratio * ASK "JOE1 [POS] ] ]

IF :IN = -2 [ASK [JOE1 JOE2] [PU] ]

MAGNIFY1 READKEY

END

? CT PR [Let you drag JOE1 by mouse]

? MAGNIFY 0.4


; CIRCLE BY COS & SIN - Procedures COS,

; SIN and SETPOS

;

; In a cycle from 1 to 360 you will change the position of a turtle

; by setting its X co-ordinate according to the cosine of the counter

; of the cycle; and setting its Y co-ordinate according to the sine of this

; counter.

;

TO CIRCLE

PU

SETX 100 * COS 0

SETY 100 * SIN 0

PD

REPEAT 360 [SETX 100 * COS REPC ~

          SETY 100 * SIN REPC]

END

? CIRCLE

;

; It is very easy to modify this procedure to draw nice ellipses. You just

; add 2 inputs that specify horizontal and vertical magnification.

;

TO CIRCLE2 :a :b

PU

SETX :a * COS 0

SETY :b * SIN 0

PD

REPEAT 360 [SETX :a * COS REPC ~

          SETY :b * SIN REPC]

END

? CS GS

? CIRCLE2 100 60

? REPEAT 11 [CIRCLE2 100 10 * (REPC - 1)]


; ELLIPSE ROTATED BY AN ANGLE - Procedures QUOTIENT,

; SETPOS, COS, SIN

;

; The following procedure will draw an ellipse - by drawing

; a circle. In fact, the circle will be magnified

; differently in the horizontal and vertical directions - inputs

; A and B. Then, each new point of the ellipse will be

; rotated by an angle.

;

TO ELLIPSE :a :b :angle

PU

SETPOS :angle / SE :a * COS 0 :b * SIN 0

PD

REPEAT 360 [SETPOS :angle / SE :a * COS REPC :b * SIN REPC]

END

? PD

? ELLIPSE 100 50 30

? CS GS

? SETPC 12 SETPW 2

? REPEAT 7 [ELLIPSE 140 80 REPC * 360/7]


; ROLL THE DICE - Procedure RANDOM, OUTPUT

;

; You can define a simple operation that can be used instead of

; a dice roll. It will randomly output one of the numbers 1, 2 ,3, 4, 5 or 6.

; As because it is an operation, you must use OP or OUTPUT to

; let Logo know what the result will be.

;

TO ROLL.THE.DICE

OP 1 + RANDOM 6

END

; See how lucky you are. How many times

; out of 1000 will you roll 6?

;

? MAKE "how.many.6 0

? REPEAT 1000 [ IF ROLL.THE.DICE = 6 [INC "how.many.6] ]

? (PR [Your result is:] :how.many.6)


; RANDOM WALK in a rectangle - Procedures < or LESS?,

; > or GREATER?, XCOR, YCOR and RANDOM

;

; You can define a procedure with two inputs - two points

; P1 and P2. P1 will specify the upper left corner of a rectangle,

; P2 will specify its lower right corner. First you create a

; turtle - WALKER5 and position it in the centre of the

; rectangle. Then it will walk randomly, but only inside

; the rectangle. (Compare this solution with its alternative that

; makes use of INSIDE?.)

;

TO WALK5 :P1 :P2

MAKETURTLE "WALKER5 SE ~

((FIRST :P1) + FIRST :P2) / 2 ~

((LAST :P1) + LAST :P2) / 2

TELL "WALKER5

ST

WALK51

END

TO WALK51

RT RANDOM 360

FD 5

IF LESS? XCOR FIRST :P1 [FD -5]

IF LESS? YCOR LAST :P2 [FD -5]

IF GREATER? XCOR FIRST :P2 [FD -5]

IF GREATER? YCOR LAST :P1 [FD -5]

WALK51

END

? CS TELL 0

? WALK5 [-120 70] [-70 -20]


; RANDOM WALK in a rectangle - Advanced Alternative

; Procedures < or LESS?, > or GREATER?

;

; You can solve the same problem, but,

; this time make use of the more advanced possibilities of

; calculations with points:

;

TO WALK6 :P1 :P2

MAKETURTLE "WALKER6 (:P1 + :P2)/2

TELL "WALKER6

ST

LOCAL [P3 P4]	; you find the other corners

MAKE "P3 SE FIRST :P1 LAST :P2

MAKE "P4 SE FIRST :P2 LAST :P1

WALK61

END

TO WALK61

RT RANDOM 360

FD 5

IF NOT GREATER? :P4 POS [FD -5]

IF NOT GREATER? POS :P3 [FD -5]

WALK61

END

? WALK6 [-120 70] [-70 -20]


; NEARLY THE SAME NUMBERS

; Procedures = or EQUAL?, NUMBER?

;

; Because the numbers in Logo are words as well,

; it is possible to use following instructions:

? SH EQUAL? 7 * 12 WORD 8 LAST [2 4]

? SH EQUAL? 27 "27

; Let's define NEARLY.EQUAL?, which will only

; output TRUE if its two inputs are both numbers

; with a difference of less than 0.001:

TO NEARLY.EQUAL? :N1 :N2

TEST AND NUMBER? :N1 NUMBER? :N2

IFT [OP ABS :N1 - :N2 < 0.001]

IFF [OP "FALSE]

END

? SH NEARLY.EQUAL? 3.33 3.3333333

? SH NEARLY.EQUAL? 3.333 3.3333333


; NAMES List and Local Variables

; Procedures NAMES, NAME and LOCAL

;

? MAKE "X 100000

? MAKE "Y 200000

TO TRY1 :IN

LOCAL [WHAT]

NAME "Hello "WHAT

TRY2 10 20 30

SH NAMES

END

TO TRY2 :A :B :C

SH NAMES

END

? TRY1 -300

? SH NAMES


; PRINT.ALL - prints all characters, items or frames one by one

; Procedures EMPTY?, FIRST and BUTFIRST

;

TO PRINT.ALL :IN	; both for words, lists and images

IF EMPTY? :IN [ STOP ]

PR FIRST :IN

PRINT.ALL BF :IN

END

? PRINT.ALL "HELLO

? PRINT.ALL [PERSONAL COMPUTER IS FUN]

? TELL 0

? PRINT.ALL GETSHAPE


; GREET - asks what your name is and greets you afterwards

; Procedures LET and READWORD

;

TO GREET

PR [WHAT IS YOUR NAME?]

LET "NAME READWORD

PR SE "HELLO :NAME

END

? GREET


; BABY.LOGO - asks you to type in any Logo instruction and

; runs it. If you enter an incorrect instruction, a non-standard

; error message appears produced with PRINT instead of ERROR.

; Procedures CATCH, LET and ERROR

; The BABY.LOGO procedure would run forever. To be able to

; to stop it by pressing F12, you have to check the error message:

;

TO BABY.LOGO

CATCH "ERROR [RUN READLIST ]

LET "err ERROR

TEST NOT EMPTY? :err

IFT [IF 25 = FIRST :err [STOP] ]

IFT [PR [OOOPS! TRY IT AGAIN! ] ]

BABY.LOGO

END

? BABY.LOGO


; GUESS.A.NUMBER - the computer wants you to guess

; a number. If you enter any fractional number like 2.6,

; computer will be angry with you.

;

; Procedures THROW, TOPLEVEL, TEST,

; STOP and READWORD

;

TO GUESS.A.NUMBER :A

PR [GUESS WHAT NUMBER I AM THINKING! ]

GUESS

PR [YOU ARE RIGHT! ]

END

TO GUESS

LOCAL "Try

MAKE "Try READWORD

IF MEMBER? ". :Try [PR [THIS IS NOT FAIR! ] THROW "TOPLEVEL ]

TEST :Try = :A

IFF [PR [MISS! TRY ONCE MORE! ] ]

IFT [STOP]

GUESS

END

; Now type in GUESS.A.NUMBER

; with 6 as its input (or any other integer)


; READ a file and PRINT it on the screen.

; The READ procedure redirects the input stream with

; READFROM. READ1 then reads the file line by line until EOF?

; is true - i.e. the end of the file is reached.

;

; Procedures EOF?, READFROM and READLIST

;

TO READ :FILE

READFROM :FILE

READ1

READFROM [ ]

END

TO READ1

IF EOF? [STOP]

PR READLIST

READ1

END

; Now find a file on your disk and type in

; READ with its name (you may also need its path).


; CREATE defines N turtles named T1 to TN.

; The following two alternative definitions do the same: they

; create N turtles named T1, T2, T3, ... etc. The first solution

; doesn't use REPCOUNT:

;

; Procedures REPCOUNT, REPEAT and MAKETURTLE.

TO CREATE1 :N

LOCAL [C]

MAKE "C 1

REPEAT :N [MAKETURTLE WORD "T :C (SE 0 0 :C * 360 / :N) INC "C]

END

TO CREATE2 :N

REPEAT :N [MAKETURTLE WORD "T REPC (SE 0 0 REPC * 360 / :N) ]

END

? ERTURTLE ALL

? CREATE2 10

? TELL ALL

? PU FD 100 PD REPEAT 60 [FD 50 RT 173]


; FIND.BLUE makes a turtle move along the screen

; until it runs into a blue region (either dark or light).

; Notice that this procedure is not recursive. In fact, it is an

; operation which outputs either FALSE or TRUE. When used

; inside WAITUNTIL, it is repeatedly evaluated until it outputs TRUE.

; Procedures WAITUNTIL, MEMBER? and DOTCOLOUR.

TO FIND.BLUE

IF MEMBER? DOTCOLOUR [1 9] [OP "TRUE]

FD 5

RT RANDOM 360

OP "FALSE

END

; load a full screen bitmap with many colours including

; blue, or draw some lines with a turtle

? TELL [0]

? PU ST

? WAITUNTIL [FIND.BLUE]


; PO prints the definitions of all chosen objects:

? MAKE "X 10

TO POLY :N :SIZE :ANGLE

REPEAT :N [FD :SIZE RT :ANGLE]

END

? PPROP "JOE "HEIGHT 199

? PPROP "JOE "EATS "TOO.MUCH

; Now you want to print out the definitions of

; three objects - variable X, procedure POLY and

; properties of the word JOE

? PO [:X POLY "JOE]


; PRINTLINE can be useful  when used with other Logo

; procedures like DIR or TEXT:

TO SOMETHING :X :Y

REPEAT 3 [PR :X]

PPROP :Y :X "READY

END

? PL TEXT "SOMETHING


; FREE HAND DRAWING with your mouse

;

; Procedures MOUSE and READKEY:

TO FREE.DRAW

FREE.DRAW1 READKEY

END

TO FREE.DRAW1 :IN

IF :IN = 0 [ PU SETPOS MOUSE PD ]

IF :IN = -1 [ SETPOS MOUSE ]

IF :IN = 27 [ STOP ]

FREE.DRAW1 READKEY

END

? FREE.DRAW


; POLY.SPI is a version of the well known POLY procedure.

; Here you use it in parallel with 5 turtles, each of which has

; a different pen pattern.

; Procedures PATTERN, DRAW and SETPATTERN.

TO POLY.SPI :STEP :ANGLE

IF :STEP < 0.5 [ STOP ]

FD :STEP LT :ANGLE

POLY.SPI :STEP-3 :ANGLE

END

? DRAW

? MAKETURTLE 0 [ -120 -60 0 ]

? MAKETURTLE 1 [ -60 30 0 ]

? MAKETURTLE 2 [ 0 -80 0 ]

? MAKETURTLE 3 [ 60 30 0 ]

? MAKETURTLE 4 [ 120 -60 0 ]

? TELL [ 0 1 2 3 4 ]

? PD HT GS

? EACH [ SETPATTERN WHO ]

? POLY.SPI 150 156


; The FULLSCREEN command can be defined with the

; SETLOGOSIZE, SETGS and

; SYSTEMMETRICS commands. In GO

; you make also use of WAIT. FULLSCREEN will

; make the graphics screen cover the whole screen:

TO FULLSCREEN

LOCAL [X Y W H]

MAKE "X (-SYSTEMMETRICS 32)

MAKE "Y (-(SYSTEMMETRICS 33) - (SYSTEMMETRICS 4) - (SYSTEMMETRICS 15) )

MAKE "W (SYSTEMMETRICS 0) - :X + SYSTEMMETRICS 32

MAKE "H (SYSTEMMETRICS 1) - :Y + SYSTEMMETRICS 33

SETLOGOSIZE (LIST :X :Y :W :H)

SETGS (LIST SYSTEMMETRICS 0 SYSTEMMETRICS 1 1 0)

GS

END

; Try this just for fun:

TO GO

SETLOGOSIZE [0 0 0 0 1] REPEAT 10 [WAIT 500 SETLOGOSIZE  ~

( LIST REPC * 20 REPC * 20 0 0 1 )]

SETLOGOSIZE [-4 -4 100 100 0]

REPEAT 10 [SETLOGOSIZE ( LIST -4 -4 100 + REPC * 40 100 + REPC * 30 0 )]

SETLOGOSIZE [ ]

END

? GO


; SCRIBBLE covers the screen with a web of

; lines. Then it changes its pen into PENERASE mode.

;

; Procedures PENERASE and SETPENWIDTH

TO SCRIBBLE

RT 1

REPEAT 40 [ FD 110 RT 178 FD 220 LT 178 FD 110 ]

END

? CS SETPW 1 SETPC 1

? SCRIBBLE

? SETPW 8

? PE

? LT 69

? REPEAT 4 [ FD 140 LT 99 ]


; You can produce surprising drawings in

; PENREVERSE mode. Try it!

;

; Procedures PENREVERSE and BACKGROUND

TO MAGIC

CS GS

SETPW 1 SETPC BG PX

MAGIC1 1

END

TO MAGIC1 :SIDE

FD :SIDE

RT 90

MAGIC1 :SIDE + 1

END

? MAGIC


; Sometimes you can design interesting drawings

; by using several turtles with different penwidths

;

; Procedures SETPENWIDTH, PENWIDTH and INC

? MAKE "I 1

? REPEAT 4 [MAKETURTLE :I [ ] INC "I ]

? TELL ALL

? CS PU

? EACH [SETPW 1 + 2 * WHO SETX -150 + 70 * WHO ]

? EACH [PR PW]

TO POLY.SPI :STEP :ANGLE

IF :STEP < 0.5 [ STOP ]

FD :STEP LT :ANGLE

POLY.SPI :STEP - 7 :ANGLE

END

? PD

? FD 50

? POLY.SPI 90 163


; If you create more turtles, you can let them work

; one by one, in groups, or all together.

;

; Procedures ALLTURTLES, TELL and EACH

? CS TELL 0

TO SQUARE :SIDE

REPEAT 4 [FD :SIDE RT 90]

END

? MAKETURTLE 1 [ 100 40 90 ]

? MAKETURTLE 2 [ -100 40 270 ]

? FD 100 	; FD moves only turtle 0,

? TELL ALL 	; from now on all three turtles are active

? SQUARE 60

? ASK BF ALL [RT 20 SQUARE 40 RT 10]

? EACH [REPEAT 20 [SQUARE (1 + WHO) * 30 RT 18]


; Instead of drawing a line, a turtle may

; jump from one position to another and draw a dot there.

;

; Procedures DOT, PENUP and PENDOWN.

TO D.POLY :N :S :U

REPEAT :N [PU FD :S PD DOT RT :U]

PU

END

? CS GS HT

? MAKETURTLE "JANE [100 0 0]

? ASK "JANE [SETPW 4]

? MAKETURTLE "MATILDA [-100 0 0]

? ASK "MATILDA [SETPW 1]

? TELL [JANE MATILDA ]

? REPEAT 30 [D.POLY 65 80 77.3 RT RANDOM 360 FD 400]


; FAN is a surprising combination

; of FORWARD with HEADING commands.

;

; Procedures HEADING, FORWARD, SETTS and BACK

TO FAN

REPEAT 77 [FD HEADING BK HEADING RT 4]

END

? MAKETURTLE 0 [ ]

? CS TELL 0 PD

? SETTS 2

? FAN

? SETHEADING 0

? LT 0.3

? PR HEADING


; The GREET procedure makes a turtle randomly walk

; along the screen and say 'Hello' in many ways.

;

; Procedures SETTTEXT and TTEXT

TO GREET

CS PU

REPEAT 70 [GREET1]

END

TO GREET1

FD 90 + RANDOM 100

RT RANDOM 360

SETTT "Arial (SE 3 * RANDOM 20 800 * RANDOM 2 RANDOM 2)

SETPC RANDOM 16

TTEXT "Hello

END

? CS GS TELL 0

? GREET


; FILLED.SQUARE is a procedure which draws a square

; first and fills it with random colour. You can use it several

; times to get ... guess what!

;

; Procedures FILL and SETFILLCOLOUR

TO FILLED.SQUARE :SIZE

REPEAT 4 [FD :SIZE RT 90]

PU RT 45 FD 3

SETFC RANDOM 16

FILL

FD -3 LT 45 PD

END

? MAKETURTLE 0 [0 -160 0]

? TELL 0

? CS GS MAKE "I 50

? REPEAT 16 [FILLED.SQUARE :I PU FD :I + 1 PD (DEC "I 3) LT 9]


; SILENT.NIGHT plays a short piece of

; the well known song.

;

; Procedure PLAY

TO SILENT.NIGHT

PLAY [R T70 L8 O2]

REPEAT 2 [PLAY [f. 16g f 4d.] ]

PLAY [L4 O# c 8c Ob a.]

PLAY [hb 8hb f.]

END

? SILENT.NIGHT	; this is only a short bit


; FUN.SUN is a procedure that draws a kind of

; sun. The turtle will stamp its shape at the end

; of each ray. However, if you shuffle the turtle's frames

; and do the same, the drawing will be completely

; different.

; Procedures SHUFFLE and STAMP

? ERTURTLE 0

? MAKETURTLE 0 [-150 0 0] TELL 0 ST

TO SUN

   REPEAT 72 [PU FD 30 PD FD 10 + RANDOM 50 STAMP PU HOME RT 5]

END

? CS SUN

? MAKETURTLE 0 [150 0 0]

? SETSHAPE SHUFFLE GETSHAPE

? SUN


; SYMMETRY creates 4 turtles with different headings

; and different home positions, all symmetrical

; around the point [0 0]

; Procedures MAKETURTLE and FILL

TO SYMMETRY

MAKETURTLE 1 [-40 -4 107]

MAKETURTLE 2 [4 -40 17]

MAKETURTLE 3 [40 4 -73]

MAKETURTLE 4 [-4 40 197]

TELL [1 2 3 4]

PENDOWN

END

? CS

? SYMMETRY

? REPEAT 13 [FD 8 RT 83 FD 67 LT 133]

? FD 35 RT 172

? REPEAT 12 [LT 178 FD 130]

? LT 149 PENUP

? FD 50

? EACH [FILL 0]

? GS


; Illustrates procedures MAKETURTLE, TELL and ASK

? ERALL

? SH ALL

? MAKETURTLE "ADDO [10 10 90]

? MAKETURTLE "ROBERT [10 10 180]

? MAKETURTLE "SANNE [10 10 270]

? TELL [ROBERT SANNE]

? SH WHO

? REPEAT 4 [FD 60 RT 90]

? FD 60

? ST

? TELL [ADDO ROBERT SANNE]

? PU FD 10 PD

? REPEAT 4 [FD 60 RT 90]

? ST

? TELL "ROBERT	; ROBERT is active

? ASK "ADDO [PENUP FD 70 PENDOWN]

? ASK "ADDO [REPEAT 4 [FD 60 RT 90]]

? ASK [ADDO SANNE] [SH WHO]

? SH WHO

? ASK "ADDO [PU]

? SETPEN ASK "ADDO [PEN]	; this changes ROBERT's pen

? PR PEN	; what is ROBERT's pen now?


; MY.BUTTONS

; Illustrates procedures IMAGE, IMAGESIZE, SETFRAME,

; SETFRAMEMODE, TELL, TEST, TOUCHED, WHO and WINDOW

; BE CAREFUL: this example erases all turtles first!

;

; Creates three images to be used to depict three

; Windows-like buttons. These buttons become

; active - try to press them with the mouse.

TO MY.BUTTONS

SETBG 11 GS ERTURTLE ALL

MAKETURTLE 0 [0 -100 ST PD]

ASK 0 [( WINDOW [-304 189 438 353] ) ~

              SETPW 5 SETPC 5 DOT SETFC 11]

MAKETURTLE 1 [140 180 SETFRAMEMODE]

ASK 1 [SETSHAPE CREATE.BUTTON [FIRST] [ARIAL 20 400 0] ST]

MAKETURTLE 2 [140 140 SETFRAMEMODE]

ASK 2 [SETSHAPE ~

              CREATE.BUTTON [SECOND] [TIMES\ NEW\ ROMAN 16 700 1] ST]

MAKETURTLE 3 [140 100 SETFRAMEMODE]

ASK 3 [SETSHAPE CREATE.BUTTON [THIRD] [SYSTEM 10 700 0] ST]

TELL [ ]

MAKE "ANGLE 0

BUTTONS.LOOP READKEY

SS

END

TO BUTTONS.LOOP :I

IF :I = 27 [SETFRAME 1 STOP]

TEST :I = 0

IFT [TEST NOT EMPTY? TOUCHED]

IFT [TEST TOUCHED <> 0]

IFT [TELL TOUCHED SETFRAME 2]

IF :I = - 1 [SETFRAME IF TOUCHED = WHO [2] [1] ]

TEST :I = - 2

IFT [IF TOUCHED = WHO [ASK 0 [PU HOME PD FILL SETH 0] ~

                                            MAKE "ANGLE ITEM WHO [177 123 89] ] ]

IFT [SETFRAME 1 TELL [ ] ]

IF :ANGLE <> 0 [ASK 0 [FD 200 LT :ANGLE] ]

BUTTONS.LOOP IF KEY? [READKEY] [1]

END

TO CREATE.BUTTON :TEXT :FONT

LOCAL [A B S]

IMAGE :FONT "FONT IMAGE 2 "WBUTTON

IMAGE 12 "LCOLOUR IMAGE 7 "RCOLOUR

MAKE "A IMAGE :TEXT "TEXT

MAKE "S [10 10] + IMAGESIZE :A

MAKE "B ( IMAGE :A SE [-5 -5] :S "COPY "UBUTTON ~

                    0 "RCOLOUR ~

                    SE [-1 -1] [2 2] + :S "COPY ~

                    [0 0] "HOT 7 "RCOLOUR ~

                    :A SE [-6 -6] :S "COPY "DBUTTON ~

                    0 "RCOLOUR SE [-1 -1] [2 2] + :S "COPY ~

                    [0 0] "HOT )

OP :B

END

? MY.BUTTONS


; COLOURS

; Illustrates procedures FRAME, SETFRAME, SETFRAMEMODE,

; SETSHAPECOLOUR, STAMP, TRUE and WHILE

; Creates an animated turtle named 100.

; Defines its active shape colour to be 0.

; Makes it move around the screen and stamp

; its shape.

TO COLOURS

CS GS

MAKETURTLE 100 [200 0 ST PU SETFRAMEMODE]

TELL 100

SETSHAPECOLOUR 0

WHILE ["TRUE] ~

     [SETPC RANDOM 16 STAMP FD 2 LT 0.5 SETFRAME FRAME + 1]

END

? COLOURS


; DIGITAL

; Illustrates procedures BUTLAST, LAST, SETBACKGROUND,

; SETTTEXT, TIME and WORD

; Creates new turtles to display the time.

TO DIGITAL

SETBG 7 GS

ASK ALL [HT]

MAKETURTLE 100 [0 -180 PX HT]

MAKETURTLE "H [-240 170 PU HT]

MAKETURTLE "M [-70 170 PU HT]

MAKETURTLE "S [100 170 PU HT]

ASK [H M S] [SETTT [ARIAL] [80 700 0 1 0]]

TELL 100 SETPC 12 SETPW 3

DIGITAL.LOOP [-1 -1 -1] BUTLAST TIME

END

; BUTLAST TIME means the current time

; without hundredths of seconds,

; i.e. only [HOURS MINUTES SECONDS]

TO DIGITAL.LOOP :OLD :NEW

IF FIRST :OLD <> FIRST :NEW [ASK "H [DIGIT FIRST :NEW]]

IF ITEM 2 :OLD <> ITEM 2 :NEW [ASK "M [DIGIT ITEM 2 :NEW]]

IF LAST :OLD <> LAST :NEW [ASK "S [DIGIT LAST :NEW]]

FD 200 LT 117

DIGITAL.LOOP :NEW BUTLAST TIME

END

TO DIGIT :NUM

IF :NUM < 10 [MAKE "NUM WORD 0 :NUM]

TT :NUM

END

? DIGITAL


; FOLLOW

; Illustrates procedures IFTRUE, ITEM, KEY?, MOUSESTATE,

; SETHEADING, TEST and TOWARDS

; Creates a new turtle named 200. Makes it follow

; all movements of the mouse. If you press the Shift or

; Ctrl key, the turtle's pen will be turned off.

TO FOLLOW

GS CS

ASK ALL [HT]

MAKETURTLE 200 [0 0 0 ST PD]

TELL 200

FOLLOW.LOOP MOUSESTATE

SS

END

TO FOLLOW.LOOP :M

IF KEY? [IF READKEY = 27 [STOP]]

IF ITEM 2 :M <> 0 [PU] [PD]

SETH TOWARDS LAST :M

TEST ABS POS - LAST :M >= 1

IFT [FORWARD 1]

FOLLOW.LOOP MOUSESTATE

END

? FOLLOW


; IMAGE.DIR

; Illustrates procedures BUTMEMBER, DEC, DIR, LOADIMAGE,

; PATH, PUTIMAGE and SETHOTSPOT

; Displays the first frame of each image

; saved in an .LGW file in IMAGE subdirectory.

TO IMAGE.DIR

MAKE "D DIR WORD ( PATH "IMAGE ) "\\\*.LGW

CS GS

ASK ALL [HT]

MAKETURTLE 300 [HT PU]

TELL 300

PUTIMAGE.DIR -305 190 :D

END

TO PUTIMAGE.DIR :X :Y :DIR

IF EMPTY? :DIR [STOP]

IF :X > 240 [MAKE "X -305 ( DEC "Y 85 )]

SETXY :X :Y TT BUT.LGW FIRST FIRST :DIR

SETXY :X :Y - 15

MAKE "IM LOADIMAGE FIRST FIRST :DIR [1 1]

PUTIMAGE SETHOTSPOT :IM [0 0]

PUTIMAGE.DIR :X + 80 :Y BF :DIR

END

TO BUT.LGW :NAM

OP BUTMEMBER ".LGW :NAM

END

? IMAGE.DIR


; PARSE

; Illustrates procedures CHAR, LIST?, OR, SHOW,

; TYPE, WORD and ASCII

; Waits for a sentence to be typed in from the

; keyboard. If the words are in lowercase, they

; are transformed into uppercase and printed.

TO PARSE

ASK ALL [HT] TELL 0

TYPE [Type Any Sentence]

(READKEY 0)

SH LIST2WORD RL "

END

TO LIST2WORD :L :RES

IF EMPTY? :L [OP :RES]

IF NOT EMPTY? :RES [MAKE "RES WORD :RES "\ ]

LET "L1 FIRST :L

IF LIST? :L1 [MAKE "L1 ( WORD "\[ LIST2WORD :L1 " "\] )]

OP LIST2WORD BF :L WORD :RES UPCASE :L1

END

TO UPCASE :W

IF EMPTY? :W [OP :W]

OP WORD UPCASE1 FIRST :W UPCASE BF :W

END

TO UPCASE1 :CH

IF OR ( ASCII :CH < 97 ) ( ASCII :CH > 122 ) [OP :CH]

OP CHAR ( ASCII :CH ) - 32

END

? CT TS

;

; Start this Example Program by Typing PARSE


; SHAPES

; Illustrates procedures EMPTYIMAGE, GETIMAGE, IMAGE,

; POLYGONLINE, SETIMODE, SETSHAPE and WHILE

; By drawing a green triangle, a new image of 36 frames

; is created. It then becomes the shape of turtle

; named 400. IMAGE -1 "RCOLOUR is used to

; make the new image transparent in the middle.

TO SHAPES

GS ASK ALL [HT]

MAKE "SHAPE EMPTYIMAGE MAKE "N 36

MAKETURTLE 400 [HT]

TELL 400

SETPC 2 SETPW 3

SETIMODE 0

IMAGE -1 "RCOLOUR

REPEAT :N [MAKE "SHAPE IMAGE :SHAPE NEWFRAME REPC]

CS

SETSHAPE :SHAPE

ST PD

WHILE [NOT KEY?] ~

     [SETPC RANDOM 15 ~

      REPEAT 180 [FD 4 LT 2] ~

      RT 3]

END

TO NEWFRAME :P

CS

SETH ( :P - 1 ) * 360 / :N + 150

POLYGONLINE [3 [20 120] 3 [23 120] 3 [30 120]]

OP IMAGE GETIMAGE [33 33 33 33] "REDUCE

END

? SHAPES


; STARS

; Illustrates procedures EACH, ERASETURTLE,

; IGNORE, LIST, POLYGON, REPCOUNT, SENTENCE,

; SETFILLCOLOUR and WHO

; BE CAREFUL: this example erases all turtles first!

;

; Random number of turtles (between 4 and 8) is created

; and located around the Origin. They draw a sequence of

; stars - without moving. If you press any key

; the process is repeated with a new set of turtles.

TO STARS

LOCAL [N]

CS GS ERTURTLE ALL

MAKE "N 4 + RANDOM 4

REPEAT :N [MAKETURTLE REPC SE [0 0] REPC * 360 / :N]

TELL ALL HT PU SETPC 1 FD 40

EACH [SETFC 9 + RANDOM 6]

REPEAT 20 [POLYGON LIST 5 LIST REPC * 10 144]

IGNORE READKEY

STARS

END

? STARS


; SYMMETRY

; Illustrates procedures ASK, ITEM, SETPENCOLOUR

; and SETXY

; Four turtles named 1000, 2000, 3000 and 4000 are

; created. They all allow simple "free hand drawing",

; however, the drawing is in parallel horizontally and

; vertically mirrored.

TO SYMMETRY

GS CS

ASK ALL [HT]

REPEAT 4 ~

[MAKETURTLE 1000 * REPC [HT PU] ~

 ASK 1000 * REPC [SETPC ITEM REPC [0 1 2 12]]]

ASK 0 [TTEXT [DRAW SOMETHING BY YOUR MOUSE]]

TELL [1000 2000 3000 4000] SETPW 2

SYMMETRY.LOOP READKEY

SS

END

TO SYMMETRY.LOOP :I

IF :I = 32 [CS]

IF :I = 27 [STOP]

IF :I = 0 [PU]

IF :I <= 0 [MY.SETXY FIRST MOUSE LAST MOUSE PD]

SYMMETRY.LOOP READKEY

END

TO MY.SETXY :X :Y

IF :X > 319 [MAKE "X 319]

IF :Y < -200 [MAKE "Y -200]

ASK 1000 [SETXY :X :Y]

ASK 2000 [SETXY - :X :Y]

ASK 3000 [SETXY - :X ( - :Y )]

ASK 4000 [SETXY :X ( - :Y )]

END

? SYMMETRY


; WRITER

; Illustrates procedures CASE, CHAR, CHOOSER, RUN,

; SETTTEXT, SETX and TEXTSIZE

; Simulates simple typewriter, but with the option

; to choose any font, style and size. The text is displayed

; in the graphics screen by TTEXT, the turtle

; itself serves as a cursor. Any time you press the

; Tab key, the Set Font Chooser opens.

TO WRITER

CS GS

MAKETURTLE 50 [-300 190 0 PU ST]

TELL 50

WRITER.LOOP READKEY

SS

END

; 27 ... 	ESC = escape from loop

; 9 ...	TAB = font chooser

; 0 ... 	MOUSE CLICK = move 'cursor' to new position

; 13 ... 	ENTER = start of next line

; ELSE	ANY LETTER = TTEXT it and shift 'cursor' to next character

TO WRITER.LOOP :I

CASE :I ~

  [27 [STOP] ~

  9 [RUN CHOOSER "SETTT] ~

  0 [SETPOS MOUSE] ~

  13 [SETXY -300 YCOR - ITEM 2 TEXTSIZE "M] ~

  [IF :I > 31 ~

        [TT CHAR :I SETX XCOR + FIRST TEXTSIZE CHAR :I]]]

WRITER.LOOP READKEY

END

? WRITER


Primitive Procedure - .CLEANMEM
.CLEANMEM   ---   command with no inputs

.CLEANMEM

Starts general garbage collection, reclaiming unused memory.

When you work with lists and other data, Logo allocates memory space for them. As soon as these structures are not needed any more (they become garbage in the memory), Logo recycles them to free the memory space. This process takes place automatically and continually to keep as much free space as possible - you have no reason to notice it at all. Beside this there is an even more general garbage collection, which takes several seconds. Therefore, it is worth using it from time to time when working with very large data structures - so that it happens when you want, rather than when Logo decides .


Primitive Procedure - .PRIMITIVES
.PRIMITIVES   ---   operation with 1 input

.PRIMITIVES  number

where

number is one of 0, 1, 2 or 3

Outputs the list of Logo primitive procedures. If the input is:

0, operation outputs the list of all English Logo primitives,

1, operation outputs the list of all national Logo primitives,

2, operation outputs the list of all English abbreviations of primitive procedures,

3, operation outputs the list of all national abbreviations of primitive procedures.


See also related procedures...

PROCS

PRIMITIVE?

DEFINED?


Primitive Procedure - .REVERSE
.REVERSE   ---   operation with 1 input

.REVERSE  any

Reverses the order of elements of any and outputs the result. Its last element will be the first one, the last but one will be the second one... etc.

Note that the output will be:

a word of the same number of characters, if the input is a word,

a list of the same number of members, if the input is a list. If any of the members is a list itself, its members will not be reversed,

an image of the same number of frames, if the input is an image.

? SH .REVERSE "BALLOON

NOOLLAB

? SH .REVERSE [ [1 2 3] [4 5 6] [7 8 9] ]

[ [7 8 9] [4 5 6] [1 2 3] ]


See related procedures...

ITEM

PICK

GENERATE

SHUFFLE


Primitive Procedure - .SETMOUSEPOS
.SETMOUSEPOS   ---   command with 1 input

.SETMOUSEPOS  point

Moves the mouse cursor to the point specified by the input. If the point doesn't lay within the screen, it is moved to the corresponding border of the screen. However, it is possible to move the cursor outside the SuperLogo window, if the window doesn't cover the whole screen.


See also related procedures...

SETMOUSECURSOR

MOUSE

MOUSESTATE


Primitive Procedure - .WINDOWSPOS
.WINDOWSPOS   ---   operation with 1 input

.WINDOWSPOS  point

.WINDOWSPOS  [ ]

The input point is a point in the graphics screen given in the turtle geometry system with the Origin in its centre. The operation .WINDOWSPOS calculates the co-ordinates of this point, when measured by Windows metrics (with [0 0] in the upper left corner of the screen).

If the input is the empty list [ ], it outputs the co-ordinates of the upper left corner of the graphics screen.


See also related procedures...

SETBUTTONSSIZE

SETLOGOSIZE

SYSTEMMETRICS


Primitive Procedure - *
   ---   operation with 2 inputs

number1 * number2

input1 * input2   is the same as   PRODUCT input1  input2

Outputs the product of the two inputs.

? SH 7 * 3

21

? SH -3 * -5

15

? PR (SE 2 "* 3 "IS 2 * 3)

2 * 3 IS 6


See also related procedures...

+

-

/

and other Numeric Operations


Primitive Procedure - +
+   ---   operation with 1 or 2 inputs

number1 + number2

+number

input1 + input2    is the same as    SUM input1  input2

Outputs the sum of the two input numbers.

? SH 22 + 18

40

? IF SUM 3 4 = 3 + 4 [PRINT "O.K.] [PRINT "SORRY]

O.K.

If the operation has only one input, it outputs the same number.


See also related procedures...

-

*

/

and other Numeric Operations


Primitive Procedure - -
-   ---   operation with 1 or 2 inputs

number1 - number2

-number

input1 - input2   is the same as   DIFFERENCE input1  input2

Outputs the difference between number1 and number2.

? PR  44 - 12

32

With one input the output is the opposite number.

? SH -2

-2

? SH -3-2

-5


See also related procedures...

+

*

/

and other Numeric Operations


Primitive Procedure - /
/   ---   operation with 2 inputs

number1 / number2

input1 / input2   is the same as   QUOTIENT input1  input2

Outputs number1 divided by number2. Division by zero causes ERROR. Note the difference between / and DIV operation, which outputs integer division of its inputs.

? SH 555555 / 32

17361.09

? SH DIV 555555 32

17361


See also related procedures...

+

*

-

and other Numeric Operations


Primitive Procedure - <
<   ---   operation with 2 inputs

number1 < number2

input1 < input2   is the same as   LESS? input1 input2

Outputs TRUE, if number1 is less than number2. Otherwise the output is FALSE.

? IF 2+3 < 6 [PR "YES] [PR "NO]

YES

Sometimes you may get a result like this:

? PR 10 / 3 	; the output has only two decimal digits,

3.33 	; however, internally it is more precise

? PR 3.33 < 10 / 3

TRUE

The Number of Decimal Places Displayed...


See also related procedures...

<=

=

>=

>

<>

GREATER?

LESS?

TRUE and FALSE


Primitive Procedure - <=
<=   ---   operation with 2 inputs

number1 <= number2

Outputs TRUE, if number1 is less than or equal to number2. Otherwise the output is FALSE.

? SH 5 <= ABS -5

TRUE

Note that the name of the operation <= is one word, therefore you cannot put a space between < and =.


See also related procedures...

<

=

>=

>

<>

GREATER?

LESS?

TRUE and FALSE


Primitive Procedure - >
>   ---   operation with 2 inputs

number1 > number2

input1 > input2   is the same as   GREATER? input1 input2

Outputs TRUE if number1 is greater than number2. Otherwise the output is FALSE.

? SH 2 > 7 / 3

FALSE

? IF 2+3 > 6 [PR "YES] [PR "NO]

NO

You may see an output like this:

? PR 10 / 3 	; the output has only two decimal digits,

3.33 	; however, internally it is more precise

? PR 10 / 3 > 3.33

TRUE

The Number of Decimal Places Displayed...


See also related procedures...

<

<=

=

>=

<>

GREATER?

LESS?

TRUE and FALSE


Primitive Procedure - >=
>=   ---   operation with 2 inputs

number1 >= number2

Outputs TRUE, if number1 is greater than or equal to number2. Otherwise the output is FALSE.

? SH 7 >= ROUND 7.44

TRUE

Note that the name of the operation >= is one word, therefore you can't put a space between > and =.


See also related procedures...

<

<=

=

>

<>

GREATER?

LESS?

TRUE and FALSE


Primitive Procedure - <>
<>   ---   operation with 2 inputs

any1 <> any2

Outputs TRUE, if the first input is different from the second one. Otherwise the output is FALSE.

? SH (SUM 2 3 4) <> 2 + 3 + 4

FALSE

? SH 8 <> 3.4 + 4.5

TRUE

Note that the name of the operation <> is one word, therefore you can't put a space between < and >. Note also that empty word and empty list (and empty image as well) are distinct objects:

? SH [ ] <> "

TRUE


See also related procedures...

<

<=

=

>

>=

GREATER?

LESS?

TRUE and FALSE


Primitive Procedure - =
=   ---   operation with 2 inputs

any1 = any2

input1 = input2   is the same as   EQUAL? input1  input2

If both inputs are numbers, the output is either TRUE or FALSE depending on whether they are equal. If both inputs are symbolic words or images, the operation outputs TRUE only if both inputs are identical. If both inputs are lists, the operation outputs TRUE only if their corresponding elements are equal.

? SH 2+3 = 4+1

TRUE

? SH "A = [A B C]

FALSE

? SH "AAA = FIRST [AA BB CC]

FALSE

? SH FPUT "A [B C] = LPUT "C [A B]

TRUE

? SH EMPTYIMAGE = BF FIRST ASK 0 [GETSHAPE]

TRUE

Note that empty word and empty list (and empty image as well) are distinct objects:

? SH [ ] = "

FALSE

Because numbers in Logo are words (numeric words), it also holds that:

? SH 7 * 12 = WORD 8 LAST [2 4]

TRUE

? SH 27 = "27

TRUE


See also related procedures...

EQUAL?

TRUE and FALSE

and other Numeric Predicates


Primitive Procedure - ABS
ABS   ---   operation with 1 input

ABS number

Outputs the absolute value of the input number.

? PRINT ABS -55.4

55.4

? PRINT ABS -5 = 5

TRUE


See also related procedures...

See the whole groups of

Numeric Operations

Numeric Predicates


Primitive Procedure - ALLTURTLES; ALL
ALLTURTLES; ALL   ---   operation with no inputs

ALLTURTLES

Outputs the list of all currently existing turtles, i.e. turtles, which you have created using MAKETURTLE.

Do not confuse this list with the output of WHO, which outputs the list of all currently active turtles - some or all of the currently existing turtles may not be active.

? SH ALL

[0]

? SH WHO

0

The order of turtles in ALLTURTLES corresponds to the order in which you have created them with MAKETURTLE. This order, however, can be changed with REORDER. You erase a turtle with ERASETURTLE. ERALL erases all turtles and immediately recreates the basic turtle named 0, and locates it at the point [0  0], the Origin of the graphics screen.


See also related procedures...

ASK

EACH

MAKETURTLE

ERASETURTLE

ERALL

REORDER

TELL

WHO


Primitive Procedure - AND
AND   ---   operation with 2 or N inputs

AND logical  logical

(AND logical ... )

Outputs TRUE if both inputs are TRUE. Otherwise, the output is FALSE. If there are more (or less) than two inputs, the output will be TRUE only if all the inputs are TRUE.

? SH AND NUMBER? FIRST [2 3] NUMBER? LAST [2 3]

TRUE

? IF AND (COUNT [1 2 3] = 3) MEMBER? 2 123 [PR "YES]

YES

? SH (AND NUMBER? 5 NUMBER? 6 NUMBER? "ABCD)

FALSE


See also related procedures and words...

OR

NOT

TRUE

FALSE


Primitive Procedure - APPEND
APPEND   ---   command with 1 or N inputs

APPEND LGO_file

(APPEND LGO_file  input2  input3  ... )

where each of input2, input3, ... is either a memory_object or a list_of_memory_objects

Saves all chosen objects into a file with the specified name. If a file with the same name already exists, all specified objects are saved at the end of the file (unlike SAVE which would in this case delete the previous contents).

If APPEND has only one input, the file is extended to all user defined procedures; that is, APPEND file  is equivalent to APPEND file PROCS, see PROCS. To save other objects, you have to explicitly specify them, for example:

? (APPEND "FILE1 PROCS [:A :B :C])
; will save all procedures and three variables,

? (APPEND "FILE2 [FUN GUN] NAMES)
; will save procedures FUN and GUN

; and all variables

About PROCS, NAMES, and PROPS Lists...

Appended objects are saved in the same form as if saved by SAVE, that is, when loaded back by LOAD, the same objects will be recreated.

Buried objects will not be saved unless they are explicitly named. To save all buried objects, use APPEND file BURIED, see BURIED.

The file will be searched for in the current work directory (which can be found as the output of the PATH operation and set by the SETPATH command), or in the directory specified by the complete path within the file name. If no extension is used, .LGO is added. If there is no file with specified name, it is created.


See also related procedures...

SAVE

LOAD


Primitive Procedure - APPLY
APPLY   ---   command with 2 inputs
      operation with 2 inputs

APPLY  procedural_object  list

where

procedural_object should expect the number of inputs identical with the number of members of the list

Applies the specified procedural_object to the inputs defined in the list:

? APPLY "PRINT [2000000]

2000000

? SH APPLY "WORD [MON KEY]

MONKEY

? SH APPLY [[X Y Z][OP :X*:Y/:Z]] [100 200 300]

66.67

? SH APPLY [LIST :%2 + :%1] [200 300]

[500]

Notice that:

APPLY behaves like a command, if its procedural_object defines a command. Otherwise it behaves like an operation,

APPLY "WORD [AA BB] is equivalent to WORD "AA "BB,

if the procedural_object specifies a procedure with a variable number of inputs, the list may have any number of members:

? SH APPLY "WORD [M O N K E Y]

MONKEY


See also related procedures...

RUN

MAP


Primitive Procedure - ARCTAN
ARCTAN   ---   operation with 1 input

ARCTAN number

Outputs the angle (in degrees) whose tangent equals the input number. The output angle is always between -90 and 90. That is, ARCTAN is an inverse function of TAN, i.e. tangent restricted to the interval (-90, 90).

? SH ARCTAN -5

-78.69

? SH ARCTAN 5

78.69

? SH TAN ARCTAN 33.5
33.5


See also related procedures...

COS

SIN

TAN

SETFORMAT

and other Numeric Operations


Primitive Procedure - ASCII
ASCII   ---   operation with 1 input

ASCII character

ASCII word

Outputs the numeric ASCII code (that is, an integer between 0 and 255, inclusive) corresponding to the input character, or to the first character of the input word.

? SH ASCII "A

65

? SH ASCII "!

33

? SH CHAR 32 + ASCII "A

a


See also related procedures...

CHAR


Primitive Procedure - ASK
ASK   ---   command with 2 inputs
  operation with 2 inputs

command:	ASK  turtle  list_of_Logo_instructions

ASK  list_of_turtles  list_of_Logo_instructions

operation:	ASK  turtle  [ expression ]

ASK  list_of_turtles  [ expression ]

If the second input to ASK is a list of instructions to be executed, ASK is a command. If the second input is a list consisting of an expression (which outputs a value), ASK is an operation.

If ASK is a command, turtle or turtles addressed in the first input will execute instructions given in the second input. These turtles can currently be either active or not - they are temporarily activated for the time required to execute the list of instructions. All turtles addressed in the first input execute the list of instructions in "parallel" - while EACH would make all currently active turtles perform it one at a time. When ASK command is completed, the WHO list of currently active turtles is restored.

? MAKETURTLE "ADDO [10 10 90]

? SH WHO

0

? ASK "ADDO [(SH "Addo "is "at POS)]

Addo is at [10 10]

If ASK is an operation, turtle or turtles addressed in the first input become temporarily active for the moment and the second input is evaluated - the result of the expression will become the output of the operation.

When ASK is completed, that is, when it outputs the result, the WHO list of currently active turtles is restored.

? MAKETURTLE "ADDO [10 10 90]

? SH WHO

0

? (SH "Addo "is "at ASK "ADDO [POS] )

[10 10]


See also related procedures...

ALLTURTLES

EACH

MAKETURTLE

TELL

WHO


Primitive Procedure - ABS: Advanced Features
ABS   ---   advanced features

ABS point

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs the magnitude of a corresponding directed line segment.

That is, if the input point = [a b ] then its magnitude

.

? SH ABS [0 0]
0
? SH ABS [-120 44]
127.81
? SH ABS [-120 44] = ABS -[-120 44]
TRUE


Primitive Procedure - APPEND: Advanced Features
APPEND   ---   advanced features

APPEND LGO_file  input2  input3  ...

where each of input2, input3, ... is either a memory_object or a list_of_memory_objects

APPEND belongs to the group of special Logo primitive procedures that can be used without brackets even if they are used with other than the basic number of inputs. In such a case all expressions up to the end of the current line are evaluated and considered to be inputs to this procedure.

This group consists of the procedures APPEND, SAVE, SAVELIBRARY and PRINTMEMORY.


Primitive Procedure - *: Advanced Features
   ---   advanced features

number * point

point * number

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point representing a directed line segment with the same direction. However, its magnitude is multiplied by the number. That is, PRODUCT number point is equivalent to SENTENCE PRODUCT number FIRST point PRODUCT number LAST point.

?SH -2 * [-20 40]
[40 -80]

point1 * point2

If the inputs are points [a b ] and [c d ], the operation outputs the result of their dot product a*c + b*d.

? SH [-2 -3] * [-15 30]
-60


Primitive Procedure - +: Advanced Features
+   ---   advanced features

point1 + point2

+point

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs the point [a b ], where a is the sum of the first components of the point1 and point2 and b is the sum of the second components of the point1 and point2.

If you consider points to represent directed line segments, point [a b ] is defined as the vector representing the sum of the input points - vectors.

? SETPOS POS + [25 35]

; is the same as

? SETX XCOR + 25

? SETY YCOR + 35

When the operation has only one input, it outputs the same point.


Primitive Procedure - -: Advanced Features
-   ---   advanced features

point1 - point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point [a b ], where a is the difference between FIRST point1 and FIRST point2 and b is the difference between LAST point1 and LAST point2. If you consider points to represent directed line segments, point [a b ] is the difference between directed line segments point1 and point2.

? SH [20 40] - [5 -30]
[15 70]

-point1

Outputs a point [a b ], where a is the opposite number to the FIRST point1 and b is the opposite number to the LAST point1. If we consider points to represent directed line segments, point [a b ] is defined as the vector having the same magnitude as point1 but whose direction is opposite to point1.


Primitive Procedure - /: Advanced Features
/   ---   advanced features

point1 / number

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point representing a directed line segment with the same direction as point1. However, the magnitude of the original point1 is divided by the input number. That is, point1 / number is equivalent to
SENTENCE (FIRST point1) / number (LAST point1) / number.

? SH QUOTIENT [130 75] 3
[43.33 25]

angle / point1

Outputs a point representing a directed line segment with the same magnitude as point1. However, the direction of the original point1 is changed by rotating it by number degrees.

? SH 90 / [0 120]	; rotating by 90 degrees to the right
[120 0]

? SH -45 / [0 120]	; rotating by 45 degrees to the left

[-84.85 84.85]


Primitive Procedure - <: Advanced Features
<   ---   advanced features

word1 < word2

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically less than word2. Otherwise the output is FALSE.

point1 < point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it holds that a < c and b < d. Otherwise the output is FALSE.


Primitive Procedure - <=: Advanced Features
<=   ---   advanced features

word1 <= word2

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically less than or equal to word2. Otherwise the output is FALSE.

point1 <= point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it holds that a <= c and b <= d. Otherwise the output is FALSE.


Primitive Procedure - >: Advanced Features
>   ---   advanced features

word1 > word2

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically greater than word2. Otherwise the output is FALSE.

point1 > point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it holds that a > c and b > d. Otherwise the output is FALSE.


Primitive Procedure - >=: Advanced Features
>=   ---   advanced features

word1 >= word2

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically greater than or equal to word2. Otherwise the output is FALSE.

point1 >= point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it holds that a >= c and b >= d. Otherwise the output is FALSE.


Primitive Procedure - BACK; BK
BACK; BK   ---    command with 1 input

BACK number

Moves all currently active turtles the given number of steps (that is, pixels) in the opposite direction to which they are heading. Depending on the mode PENUP, PENDOWN, PENERASE or PENREVERSE of each turtle's pen, it either doesn't draw a line, draws a line (in the currently set colour, width and pattern), erases a line or reverses a line.

If the active turtle is SHOWN?, its shape is displayed before and after the move.

Note that BACK number is the same as FORWARD -number.

? BACK 40	; moves back

? BACK -40	; moves forward 40 steps

? REPEAT 4 [BACK 100 LT 90]	; draws a square by moving back


See also related procedures...

FORWARD

SETHEADING

SETPOS

TOWARDS


Primitive Procedure - BACKGROUND; BG
BACKGROUND; BG   ---   operation with no inputs

BACKGROUND

Outputs the actual background colour of the graphics screen. To change this colour, use SETBACKGROUND. When Logo is started, the background colour of the graphics screen is defined as white, that is, 15.


See also related procedures...

PENCOLOUR

SETBACKGROUND

SETPENCOLOUR

SETTC


Primitive Procedure - BURIED
BURIED   ---   operation with no inputs

BURIED

How and Why You Bury Memory Objects...

Creating and Using a Library...

Outputs the list of all currently buried objects.

Similar to the notation in PROCS, NAMES, and PROPS lists, items in the BURIED list either start with no special character (if they are user-defined procedures), start with colon (:) (if they are variables), or start with quotation mark (") (if they are words with defined properties).

About PROCS, NAMES, and PROPS Lists...

? BURY (SE [F G] [:VAR1 :VAR2 :VAR3] ["JOE1 "JOE2])

; 2 procedures, 3 vars and 2 props

? SH BURIED

[F G :VAR1 :VAR2 :VAR3 "JOE1 "JOE2]

To bury all user-defined objects, use BURYALL. To bury only certain objects, use BURY. To unbury an object, use UNBURY. To make all buried objects temporarily visible, use SETBURY "FALSE.

Alternative:

The Show Also Buried command in the Objects menu of the Memory Window displays also the names of all currently buried objects


See also related procedures...

BURY

BURYALL

SETBURY

UNBURY


Primitive Procedure - BURY
BURY   ---   command with 1 input

BURY memory_object

BURY list_of_memory_objects

How and Why You Bury Memory Objects...

Creating and Using a Library...

Makes all user-defined memory objects shown in the input invisible, that is buried. Buried objects are not displayed and processed by Logo in the usual way:

How Logo Displays and Processes  Buried Objects

To bury all user-defined objects, use BURYALL. To find all buried objects, use BURIED. To unbury an object, use UNBURY. To temporarily make all buried objects visible, use SETBURY "FALSE.

PROCS, NAMES, and PROPS lists are often used as inputs to BURY. Currently buried objects are not members of these lists - unless they are temporarily made visible by SETBURY "FALSE or by Show Also Buried in the Objects menu of the Memory Window.

About PROCS, NAMES, and PROPS Lists...

Alternative:

Bury in the Objects menu of the Memory Window


See also related procedures...

UNBURY

BURYALL

BURIED

SETBURY


Primitive Procedure - BURYALL
BURYALL   ---   command with no inputs

BURYALL

How and Why You Bury Memory Objects...

Creating and Using a Library...

Makes all user-defined memory objects invisible, i.e. buried. Buried objects are not displayed and processed by Logo in the usual way:

How Logo Displays and Processes  Buried Objects

To bury only specified objects, use BURY. To find all currently buried objects, use BURIED. To unbury a specified object, use UNBURY. Currently buried objects are not members of PROCS, NAMES, and PROPS lists - unless they are temporarily made visible by SETBURY "FALSE or by Show Also Buried in the Objects menu of the Memory Window.

Alternative:

Bury command in the Objects menu of the Memory Window


See also related procedures...

UNBURY

BURY

BURIED

SETBURY


Primitive Procedure - BUTFIRST; BF
BUTFIRST; BF   ---   operation with 1 input

BUTFIRST any

where any is any non empty word, list or image

If the input is a word, BUTFIRST outputs a word containing all but its first character. If the input is a list, BUTFIRST outputs a list containing all but its first member. If the input is an image, BUTFIRST outputs an image containing all but its first frame.

? PR BUTFIRST "LOGO

OGO

? PR BF [ ]

MESSAGE: butfirst doesn't like [ ] as input

? SH BF BF [ [A 2] [B 3] [C 4] ]

[ [C 4] ]


See also related procedures...

BUTLAST

FIRST

FPUT

LAST

LPUT


Primitive Procedure - BUTLAST; BL
BUTLAST; BL   ---   operation with 1 input

BUTLAST  any

where any is any non empty word, list or image

If the input is a word, BUTLAST outputs a word containing all but its last character. If the input is a list, BUTLAST outputs a list containing all but its last member. If the input is an image, BUTLAST outputs an image containing all but its last frame.

? PR BUTLAST [ [1 I] [2 II] [3 III] ]

[1 I] [2 II]

? SH BL LAST LAST BL [ [A 56] [B 78] [C 91] ]

7


See also related procedures...

BUTFIRST

FIRST

FPUT

LAST

LPUT


Primitive Procedure - BUTMEMBER
BUTMEMBER   ---   operation with 2 inputs

BUTMEMBER  character  word

BUTMEMBER  any  list

The operation deletes all occurrences of the first input in the second input. The result then becomes the output of BUTMEMBER.

If the second input is a word, BUTMEMBER deletes all occurrences of the character in the word. If the second input is a list, all its members that are identical (in the sense of EQUAL?) with any, are deleted from the list.

? SH BUTMEMBER "L "HELLO

HEO

? SH BUTMEMBER 1 [[1][2][3]]

[[1][2][3]]

? SH BUTMEMBER 1 [1 2 3 1 2 3]

[2 3 2 3]

? SH BUTMEMBER [A] [[B][C][D][A][A] 10000]

[[B][C][D] 10000]


See also related procedures...

MEMBER

MEMBER?

FILTER

FROMMEMBER

REPLACE


Primitive Procedure - BUTTONS
BUTTONS   ---   operation with no or 1 inputs

BUTTONS

(BUTTONS number )

where number is an integer between 1 and 30

If it has no inputs, the operation outputs the list of all button definitions associated with all buttons in the Buttons Window. If the operation has one input, the actual button definition associated with the corresponding button becomes the result.

To define the text/graphics and behaviour of buttons in the Buttons Window, use SETBUTTONS. To make the Buttons Window appear on the screen, use SHOWBUTTONS. To hide it, use HIDEBUTTONS.

? SETBUTTONS [ ]

? SETBUTTONS [ [cs] [ [go] [FD 100 RT 90] ] [setpc] ]

? SH BUTTONS

[ [cs] [ [go] [FD 100 RT 90] ] [setpc] ]

? SH (BUTTONS 2)

[ [go] [FD 100 RT 90] ]

? SETBUTTONS LPUT [setpw] BUTTONS

? SH BUTTONS

[ [cs] [ [go] [FD 100 RT 90] ] [setpc] [setpw] ]


See also related procedures...

SETBUTTONS

BUTTONSSIZE

SETBUTTONSSIZE

SHOWBUTTONS

HIDEBUTTONS


Primitive Procedure - BUTTONSSIZE
BUTTONSSIZE   ---   operation with no inputs

BUTTONSSIZE

Outputs the list of 4 or 5 members describing the actual position and size of the Buttons Window, optionally together with its title.

The output list has the form of [X Y w h ] or [X Y w h text ], where X and Y are absolute screen co-ordinates of the upper left corner of the window and w and h are the width and height of its client area. If the title has been modified and is different from the standard Buttons, it is also included in the list as its fifth member.

To redefine the size, position or the title of the window, use SETBUTTONSSIZE.


See also related procedures...

SETBUTTONSSIZE

BUTTONS

SETBUTTONS

SHOWBUTTONS

HIDEBUTTONS


Primitive Procedure - BYE
BYE   ---   command with no or 1 input

BYE

(BYE  logical )

Quits the Super Logo application. If the command has no input or if the input is TRUE, a dialogue box opens which warns you not to lose your graphics or any user defined objects.

If there is an input and it is FALSE, Logo quits without asking any questions.

Alternatives:

press Alt+F4 or Alt+X,

File menu command Exit Logo in the Main Window,

double-click the SuperLogo application control menu box.


See also related procedures...

There are no other Logo primitive procedures to close the application except BYE.
However, there are more ways to close it from within the application itself.

How to Close SuperLogo


Primitive Procedure - BURY: Advanced Features
BURY   ---   advanced features

(BURY input1  input2 ... )

where each input is either a memory_object or a list_of_memory_objects

It is sometimes helpful to set more than one object or more than one list of objects to be buried in one step. So:

? MAKE "A [F G H]

? MAKE "B [:Var1 :Var2]

? BURY SE :A :B	; is equivalent to

? (BURY :A :B)


Primitive Procedure - CASE
CASE   ---   command with 2 inputs
    operation with 2 inputs

CASE  any [case1  case2 ... ]

where

each case consists of either:

two Logo selector  structures list_of_instructions (note that these two structures forming one case are not enclosed together in the brackets [ ... ] ),

two Logo selector  structures [expression] (note that these two structures are not enclosed together in the brackets [ ... ] ),

one Logo structure list_of_instructions, if it is the last case of the CASE procedure. This case will play the role in the "ELSE case",

one Logo structure [expression], if it is the last case of the CASE procedure. This case will play the role in the "ELSE case",

if any, the first input to the procedure CASE is a word, then each case can be a sequence

word1 word2 ... wordN  list_of_instructions   or

word1 word2 ... wordN  [expression]

and selector is any Logo value.

CASE first evaluates any, its first input, and then tries to match its value with the selector (or selectors) of each case until the comparison is TRUE. Note that selectors are not evaluated. To compare any with a selector, Logo makes use of EQUAL?. Next, when the successful selector is found, the list_of_instructions or [expression] of this case is run.

No other comparisons are done and CASE then stops. If the successful case contains a list_of_instructions, CASE is a command. If the case contains an [expression], the whole CASE is an operation and outputs the value obtained by running [expression].

If any is a word and a case contains several selectors, word1 word2 ... wordN, the case is successful if any of these words is EQUAL? to any. If no comparison is TRUE and there is an "ELSE case" in the structure, the list_of_instructions or [expression] of that case is run. If there is no "ELSE case" in the structure, then:

if CASE is a command, it stops and nothing happens,

if CASE is an operation, an error occurs.

? MAKE "K 100

? CASE :K * 3 [200 [PR "NO] 300 [PR "YES] 400 [PR "NO]]
YES

? CASE :K [10 20 30 [MAKE "K :K * 3] [MAKE "K :K/10]]

? SH :K

10

? MAKE "K CASE MOD :K 2 [0 [:K * 2 + 1] 1 [:K * 2]]

? SH :K

21


See also related procedures...

IF

TEST


Primitive Procedure - CATCH
CATCH   ---   command with 2 inputs

CATCH  word  list_of_Logo_instructions

Evaluates all Logo instructions in the input list from left to right. If the THROW command with the same word as its input is encountered during this evaluation, control is returned to CATCH and instruction which follows CATCH is evaluated.

? CATCH "HALLOO [PR "A THROW "HALLOO PR "B] PR [I AM HERE]

A

I AM HERE

? 	; word A was printed, the rest of the list was not 'caught'

? REPEAT 3 [CATCH "HERE [PR "A THROW "HERE PR "B ] ]

A

A

A	; B is never printed

The first input to CATCH is a kind of a label through which CATCH "declares": If you encounter a THROW word  instruction during the evaluation of a list, stop the current procedure and keep stopping higher-level procedures until you reach this label. This is how THROW and CATCH do a non local exit, while STOP and OUTPUT do a local exit of a user-defined procedure.

If the first input to CATCH is ERROR, that is, CATCH "ERROR list, any error which occurs during the evaluation of the list will be caught here - no error message will be printed and following instructions can define your own action in any particular error situation.

Try to understand CATCH and THROW together. Be careful when using them.

Try to fully understand ERROR - both word and operation - before using it with CATCH.


See also...

THROW

STOP

ERROR

TOPLEVEL


Primitive Procedure - CHAR
CHAR   ---   operation with 1 input

CHAR number

where number is an integer between 0 and 255, inclusive

Outputs a character whose ASCII code is the number. To find the ASCII code corresponding to an input character (or to the first character of a word),  use ASCII.

? PR CHAR 122

z

? SH CHAR 32 + ASCII "E

e


See also...

ASCII


Primitive Procedure - CHOOSER
CHOOSER   ---   operation with 1 input

CHOOSER  Logo_procedure

This operation makes it possible to start any Logo chooser from any user-defined procedure. The input is the name of a Logo primitive procedure which has a chooser. The CHOOSER operation opens this chooser and lets you choose the options offered in it. Now there are two possibilities:

either - after choosing - you close the chooser by pressing Enter or Write it!. In this case the output of the CHOOSER operation is a list containing a complete Logo instruction, that is, the Logo procedure's name together with its inputs set in the chooser, or

you press Esc or Cancel. In this case the output is an empty list.

? SH CHOOSER "LT

[LT 90]	; if the user chooses 90 and clicks OK

? SH CHOOSER "SETPC

[SETPC [35 105 125] ]
? MAKE "COLOUR LAST CHOOSER "SETPC
; the user chooses a colour and the code of that
; colour is set to the variable COLOUR. For example:

? SH :COLOUR

[35 105 125]
? MAKE "COLOUR CHOOSER "SETPC

? IF NOT EMPTY? :COLOUR [MAKE "COLOUR LAST :COLOUR]
; the same as above but also takes into account that
; the user might not have chosen a colour but could have
; pressed the CANCEL button in the chooser, or Esc key

; on the keyboard. In that case
; the result of the CHOOSER operation would be an
; empty list.


See also...

RUN

SHOWBUTTONS

HIDEBUTTONS

LOADPROBLEM

CLOSEPROBLEM


Primitive Procedure - CLEAN
CLEAN   ---   command with no inputs

CLEAN

Cleans the graphics screen, that is, covers it with the current background colour.

Unlike the CLEARSCREEN command, CLEAN affects neither the current heading of any active turtle, nor its position or its pen state. To find the background colour, use BACKGROUND. To change it, use SETBACKGROUND.


See also...

CLEARSCREEN

DRAW

HOME


Primitive Procedure - CLEARSCREEN; CS
CLEARSCREEN; CS   ---   command with no inputs

CLEARSCREEN

Clears the graphics screen, that is, covers it with the actual BACKGROUND colour.

Each turtle is moved (without drawing a line) to its home position and basic heading, as set at the time it was created with MAKETURTLE. The list of active turtles is not modified. All shown turtles remain shown and hidden turtles remain hidden, see HIDETURTLE and SHOWTURTLE. It does not  change the colour, pattern, width and mode (penup/pendown) of any turtle's pen.

Compare CLEAN, DRAW and CLEARSCREEN carefully.

Alternatives:

Window Menu Clear Graphics command in the Main Window,

click the right mouse button anywhere in the graphics screen and choose Clear Graphics in the pop-up menu.


See also...

CLEAN

DRAW

CLEARTEXT

HOME

GRAPHICSCREEN

SPLITSCREEN

TEXTSCREEN


Primitive Procedure - CLEARTEXT; CT
CLEARTEXT; CT   ---   command with no inputs

CLEARTEXT

Clears the text screen, that is, covers it with the current text screen background colour, prints the text prompt in the upper left corner of the text screen and places the text cursor next to it.

Normally, if not redefined by the SETPROMPT command, the text prompt is a question mark followed by a space (? ).

The current colour of the text screen background and the colour of the text printed in it can be set by SETTC. To specify the number of lines of the text screen, use the SETTS command.

Alternative:

Window Menu Clear Text in the Main Window


See also...

CLEARSCREEN

GRAPHICSCREEN

SPLITSCREEN

TEXTSCREEN

SETPROMPT

SETTC


Word with Special Meaning - CLIPBOARD
CLIPBOARD   ---   word with a special meaning

Logo_procedure  "CLIPBOARD

where Logo_procedure is a File Management procedure for loading or saving

Loading a LGO file, screen, image, library or reading from a text file may be redirected by using the appropriate Logo procedure with the word "CLIPBOARD instead of specifying the file name. If the Windows Clipboard currently contains information of the expected type, it is loaded from there.

The same is true of saving a LGO file, screen etc. If you use the word "CLIPBOARD instead of the file name, the specified contents are stored in the Clipboard. Memory objects can also be put in the Clipboard by using Cut or Copy in the Edit Menu of the Memory Window, or -

in the case of bitmaps with Cut or Copy in Paintbrush or other Windows applications,

in the case of texts with Cut or Copy in Write or similar Windows applications.


See also advanced features of ...

LOAD

SAVE

LOADIMAGE

SAVEIMAGE

LOADLIBRARY

SAVELIBRARY

LOADBITMAP

SAVEBITMAP

LOADSCREEN

SAVESCREEN

READFROM

PRINTTO


Primitive Procedure - CLOSEPROBLEM
CLOSEPROBLEM   ---   command with 1 input

CLOSEPROBLEM  TXT_file

Closes the Problem Window containing the problem specified by the given TXT file name. If the file does not exist or is not currently displayed on the screen, nothing happens.

To display a problem on the screen, use the LOADPROBLEM command.


See also...

LOADPROBLEM


Primitive Procedure - CLOSEVIDEO
CLOSEVIDEO   ---   command with 1 input

CLOSEVIDEO  word

where

word is an alias specified by the second input of the corresponding OPENVIDEO operation

In a sense, the input word of the CLOSEVIDEO command is the name of a video window (not usually its title). The command closes the video file associated with this particular window and also closes the window.


See also related procedures...

OPENVIDEO

MCI


Special Word - CODEAREA
CODEAREA   ---   word with a special meaning

This is the name of a property which specifies rectangular areas on the graphics screen that will be sensitive to the left mouse button.

CODEAREA is a word for which you define properties describing the rectangles and codes corresponding to them that will be reported by READKEY whenever you click (that is, you press and release) the left mouse button inside the area. If, for example, you define

? PPROP "CODEAREA 113 [30 100 70 60]

you specify a rectangle with [30 100] as its upper left corner and [70 60] as its bottom right corner. From now on, whenever you click inside this area, READKEY will output code 113.

You can use any integer as a code(that is, you are not limited to ASCII codes). For CODEAREA you can define any number of properties (with different codes as their names) and thus define any number of rectangles.

? PPROP "CODEAREA 1000 [-210 100 -180 80]

? PPROP "CODEAREA 1001 [-210 70 -180 50]

? PPROP "CODEAREA 1002 [-210 40 -180 20]

Study the difference between CODEAREA and TOUCHED carefully .


See also...

READKEY

MOUSE

PPROP

TOUCHED


Primitive Procedure - COS
COS   ---   operation with 1 input

COS angle

Outputs the cosine of the input angle (given in degrees).

? PR COS 90

0

? PR ARCTAN (SIN  45) / COS  45

45

? PR ARCTAN SIN 45 / COS 45

; first of all COS is evaluated, then /,

; after that SIN and ARCTAN are evaluated

41.86


See also...

ARCTAN

SIN

TAN

and other Numeric Operations


Primitive Procedure - COUNT
COUNT   ---   operation with 1 input

COUNT any

If the input is a word, COUNT outputs its number of characters. If the input is a list, COUNT outputs its number of members. If the input is an image, COUNT outputs  its number of frames.

Be careful: [A  B  [C  D] ] has three members, namely A, B and [C  D], not four.

? SH COUNT "LOGO

4

? SH COUNT [LOGO]

1

? SH COUNT BF "A

0


See also...

ITEM

MEMBER?

EMPTY?


Primitive Procedure - CURSOR
CURSOR   ---   operation with no inputs

CURSOR

Outputs a list [column row ] of two positive integer numbers that represent the current location of the cursor in the text screen.

Location [1 1] of the cursor represents the upper left corner of the text screen when it is in TEXTSCREEN mode.

To change the location of the cursor, use SETCURSOR. To find the current position of the first active turtle in the graphics screen, use POS. To change the colour of the text (that is, colour of the text screen background and the text itself), use SETTC.

? CT TS

? REPEAT 200 [SETCURSOR SE 1 + RANDOM 80 1 + RANDOM 26 TYPE "WOW!]


See also...

SETCURSOR

SETTC


Primitive Procedure - CLIPBOARD: Advanced Features
CLIPBOARD   ---   advanced features: operation with no input

CLIPBOARD

When used as an operation, the procedure outputs a list of the Windows Clipboard contents types. This list may contain one or more of the following words (in the first column):

2	specifying standard bitmap,

1	specifying text,

7	specifying OEM Windows text,

LGW	specifying Logo image structure,

LOGOPROJECT	specifying Logo project structure.

? MAKE "A GETSHAPE

TO NOTHING
PR 1000000

END

? (SAVE "CLIPBOARD NAMES PROCS)

? SH CLIPBOARD

[1 7 LGW]	; LGO and LGW contents were created

? SAVELIB "CLIPBOARD

? SH CLIPBOARD

[LOGOPROJECT]


Primitive Procedure - DATE
DATE   ---   operation with no inputs

DATE

The operation outputs a list of four members in the form [day month year day_of_week], where the day_of_week is a number between 0 and 6, inclusive. 0 corresponds to Sunday, 1 to Monday ... etc.


See also related procedures...

DATEWORD

TIME

TIMEWORD


Primitive Procedure - DATEWORD; DATEW
DATEWORD; DATEW   ---   operation with no input

DATEWORD

The operation takes the date from the computer and outputs it in the form of a word based on the settings in the Windows Control Panel's International option.

? PR DATEWORD
21. December 1994 	; the result depends on settings in Windows

? SH WORD? DATEW

TRUE


See also related procedures...

DATE

TIME

TIMEWORD


Primitive Procedure - DEBUG
DEBUG   ---   command with 1 input

DEBUG  list_of_Logo_instructions

Starts Logo debugging mode, that is, a mode in which it is possible to trace and watch an action specified by the input list of instructions either in single steps or in bigger sections. This command can only be used from the command line, it must be the only command in the line. Therefore, DEBUG cannot be used inside REPEAT or IF commands etc.

How to Debug and Trace Logo Computations


See also related procedures...

PAUSE

STOP

RUN


Primitive Procedure - DEC
DEC   ---   command with 1 or 2 inputs

decrement

DEC variable_name

(DEC variable_name  number )

Decrements (reduces) by 1 the variable named by the input - if the command has only one input. Otherwise, it decrements the variable by a given number. The value of the variable must be a number.

DEC "A   is equivalent to   MAKE "A :A - 1

(DEC "A 5)   is equivalent to   MAKE "A :A - 5

? MAKE "WHAT 101

? DEC "WHAT

? SH :WHAT

100

? DEC :WHAT

MESSAGE: Variable 100 has no value


See also related procedures...

INC


Primitive Procedure - DEFINE
DEFINE   ---   command with 2 inputs

DEFINE  word  definition_list

Defines a procedure with the given word as its name and the given definition list as its text.

DEFINE is used with TEXT to process programs as data. The word cannot be the same as any Logo primitive procedure's name or any Logo special word. If  a user-defined procedure with the same name as the word already exists, it is redefined.

TO INCREASE.BY.5 :X

OP :X + 5

END	; it adds 5 to the input

? MAKE "T TEXT "INCREASE.BY.5

? SH :T

[ [X] [OP :X + 5] ]

? DEFINE "INCREASE.BY.6 LIST [X] [OP :X + 6]

? SH INCREASE.BY.6 -3	; this new operation adds 6 to the input

3


See also related procedures...

DEFINED?

TEXT


Primitive Procedure - DEFINED?
DEFINED?   ---   operation with 1 input

DEFINED? word

Outputs TRUE if the word is the name of any user-defined procedure. Otherwise, the output is FALSE.

Primitive procedures are not user-defined and are recognised by the PRIMITIVE? operation. To find the list of all user-defined procedures, use PROCS.

? SH DEFINED? "NAME

FALSE

? SH PRIMITIVE? "DOUBLE

FALSE

TO DOUBLE :X

OP 2 * :X

END

? SH DEFINED? "DOUBLE

TRUE

Other alternative:

the word  - if it is DEFINED? - is listed in the List of Objects unless it is buried by BURY or by Objects Menu Bury. (However, even if the word procedure is buried, it may be listed in the List of Objects if you make it temporarily visible with SETBURY "FALSE or with Show Also Buried in the Memory Window.)


See also related procedures...

DEFINE

TEXT

PRIMITIVE?

PROCS

TO

TRUE and FALSE


Primitive Procedure - DIFFERENCE
DIFFERENCE   ---   operation with 2 inputs

DIFFERENCE number1  number2

DIFFERENCE input1  input2   is the same as   input1 - input2

Outputs the difference between number1 and number2.

? PR DIFFERENCE 44 -12

56


See also related procedures...

PRODUCT

SUM

QUOTIENT

SETFORMAT

and other Numeric Operations


Primitive Procedure - DIR
DIR   ---   operation with no, 1 or N inputs

(DIR)

DIR  filter

(DIR  filter1  filter2 ... )

If there is no input specified, the output will be the list of all files in the work directory. If there are one or more inputs, it only lists those files that match any of the filters filter1, filter2, ... DIR with no inputs is therefore equivalent to DIR "*.\*.

To list only bitmaps in the work directory, you type:

? SHOW DIR "*.BMP

[ [DELAUNAY.BMP 128758] [POSTMAN .BMP 128758] ]

Each file is listed as a pair [name.of.file size.of.file ]. To make the output of the DIR operation more readable, use PRINTLINE:

? PL DIR "*.LGP

HIGHWAY.LGP 1560

PIG-HUNT.LGP 780

NAUTILUS.LGP 5


See also related procedures...

PATH

SETPATH

PRINTLINE


Primitive Procedure - DIV
DIV   ---   operation with 2 inputs

DIV number1  number2

Outputs an integer division of the inputs. If the inputs are not integer numbers, they are first truncated by INT.

The remainder of the integer division of the first input by the second is produced by MOD. Note the difference between DIV and QUOTIENT, which outputs the result of division:

? PRINT DIV 14 4

3

? PRINT QUOTIENT 14 4

3.5

? PRINT MOD 14 4

2


See also related procedures...

MOD

QUOTIENT

and other Numeric Operations


Primitive Procedure - DOT
DOT   ---   command with no inputs

DOT

Each active turtle, whose pen is set to PENDOWN, prints a dot at its current position using the colour and width of its pen.

Note that DOT is equivalent to FORWARD 0, see also FORWARD.


See also related procedures...

DOTCOLOUR

MAKETURTLE

FORWARD

SETPEN

SETPENWIDTH

SETPENCOLOUR


Primitive Procedure - DOTCOLOUR
DOTCOLOUR   ---   operation with no inputs

DOTCOLOUR

Outputs an integer between 0 and 15 depending on the colour of the point of the graphics screen where the first active turtle is currently positioned.

To find current position of the first active turtle, use POS. To change the background colour of the whole graphics screen, use SETBACKGROUND. To find the actual "global" background colour (which may be different from the actual colour of any particular point), use BACKGROUND.

? SETBG 7

? CS

? PR DOTCOLOUR

7	; all points of the graphics screen are now grey


See also related procedures...

DOT

FORWARD

PENCOLOUR


Primitive Procedure - DRAW
DRAW   ---   command with no inputs

DRAW

Prepares the graphics screen for drawing by clearing the screen, erasing all turtles and recreating only turtle 0 (in its basic state - see MAKETURTLE), making it active and shown, see SHOWTURTLE.

DRAW is equivalent to the following sequence of commands:

? CS

? SETBG 15

? ERTURTLE ALL

? MAKETURTLE 0 [ ]

? TELL 0

? WRAP

? ST


See also related procedures...

CLEARSCREEN

HOME

CLEAN


Primitive Procedure - EACH
EACH   ---   command with 1 input

EACH list_of_Logo_instructions

All active turtles (in the order specified by WHO) execute the given list of instructions.

For a moment only the first of all currently active turtles becomes active and executes all instructions of the input. Then the second turtle of the currently active turtles does the same, then the third one, etc.

You can make use of WHO in the list of instructions: its value at any moment is the name of the only active turtle which is currently executing the list. After evaluating EACH command, the same turtles as before are active.

While EACH makes active turtles perform the given list of instructions one at a time, ASK makes all addressed turtles perform it in "parallel".

? CS GS

? REPEAT 5 [MAKETURTLE REPC (SE -150 + REPC * 50 0 0)]

? TELL [1 2 3 4 5]

? ST

? REPEAT 40 [FD 140 LT 189]

? RT 180 SETPC 4

? EACH [ REPEAT 40 [FD 140 LT 189]]


See also related procedures...

ALLTURTLES

ASK

MAKETURTLE

REORDER

TELL

WHO


Primitive Procedure - EDIT; ED
EDIT; ED   ---   command with 1 input

EDIT  memory_object

EDIT [ memory_object ]

where memory_object is either a name of a new object or of an object already defined

Opens and activates the Memory Object Text Editor or the Memory Object Image Editor (depending on what kind of object are you going to edit - if it is a procedure, a variable with a word or a list as its value, a word with properties, or a new name, the Text Editor is started. If it is a variable with an image value, the Image Editor is started). If the input is a new name, a new object is created in the Memory.

Primitive procedures and words with special meanings can't be edited. The same is true for any memory object which is currently hidden by BURY, unless it is actually made temporarily visible by SETBURY. If any variable's value is a list containing the empty word as its member (or as the member of its member ..., etc.) the variable can't be edited without corrupting its value. (Empty words would be removed by the editor.) If the value of a variable is a list containing an image, it can't be edited as a whole either.

EDIT can be also started with a user-defined procedure. In this case the instructions are paused and resume only after you close the editor's window.

Alternatives:

if an object doesn't exist, you can create it with Add Procedure, Add Variable, or Add Property in the Memory Window,

if the object already exists, you can edit it in the Memory Window.


See also related procedures...

EDITFILE

BURY

SETBURY


Primitive Procedure - EDITFILE; EDFILE
EDITFILE; EDFILE   ---   command with 1 input

EDITFILE file

Opens the File Editor Window and starts it. In this mode you edit or create any specified text file.

If file with the specified name doesn't exist, it is created. However, if no changes are made to the contents of the file, it is not saved when the Text Editor Window is closed (that is, if it is a new empty file, it is not even created).

If only a partial or no path is specified within the given file name, the current work directory is used to find the proper directory. To understand the rule for finding and setting the work directory, see PATH and SETPATH with "PROJECT as the input, and SETLOGO with "AUTOPATH as its input. To see another way of reading text files, see READFROM.

If no extension is specified, EDITFILE adds .LGO.


See also related procedures...

EDIT

LOAD

SAVE

READFROM


Primitive Procedure - EMPTY?
EMPTY?   ---   operation with 1 input

EMPTY? any

Outputs TRUE if any is either an empty word, an empty list or an empty image. Otherwise it outputs FALSE.

? SH EMPTY? [ ]

TRUE

? SH EMPTY? BF BL "SIR

FALSE

Note that empty word, empty list and empty image are distinct objects:

? SH EQUAL? BF "A BF [A]

FALSE

? SH BF LOADIMAGE "CARS [1 1]

{image0}

? SH EQUAL? BF "C BF LOADIMAGE "CARS [1 1]

FALSE


See also related procedures...

NUMBER?

LIST?

WORD?

IMAGE?

TRUE and FALSE


Primitive Procedure - EMPTYIMAGE
EMPTYIMAGE   ---   operation with no inputs

EMPTYIMAGE

Outputs an empty image, that is, an image containing no frames.

An empty image, like any other image, can be assigned to a turtle as its new shape with the SETSHAPE command. Its size is [0 0]. Note that an empty image, empty list and empty word are distinct objects.

? MAKE "X EMPTYIMAGE

? SH IMAGESIZE :X

[0 0]

? SH COUNT :X

0

? SH COUNT IMAGE :X :X

0	; an empty image joined with itself

; is still the empty image

? TELL 0	; make 0 have the basic shape with 24 phases

? SH GETSHAPE = IMAGE :X GETSHAPE

TRUE


See also related procedures...

IMAGE

IMAGE?

EMPTY?


Word with a special meaning - END
END   ---   word with special meaning

Marks the end of a procedure definition. The word END closes each user-defined procedure.

When typed on a separate line in the procedure definition mode (started with TO), the mode is changed to the common dialogue specified by the prompt.

Although END is the last line of each user-defined procedure, it is not included in the definition list of this procedure.

Alternative Ways to Define Procedures


See also related procedures...

TO

EDIT

TEXT


Primitive Procedure - EOF?
EOF?   ---   operation with no input

end of file?

EOF?

Outputs FALSE if the standard input stream comes from the keyboard, (see READFROM). The output is also FALSE if the input stream currently comes from a file and this file has not been completely read yet (by READLIST, READWORD or READCHAR). The output is TRUE if you have just read the last line of the file (with READLIST), its last word (with READWORD) or its last character (with READCHAR).

Printing to and Reading from a File


See also related procedures...

READFROM

PRINTTO

READLIST

READCHAR

READWORD

TRUE and FALSE


Primitive Procedure - EQUAL?
EQUAL?   ---   operation with 2 or N inputs

EQUAL? any1  any2

(EQUAL? any ... )

EQUAL? input1  input2   is the same as   input1 = input2

Outputs TRUE if both inputs are identical words (text or numeric), identical images or lists. Otherwise the output is FALSE.

If the number of inputs is other than two, EQUAL? outputs TRUE if all inputs are identical. Otherwise the output is FALSE.

? SH EQUAL? 5 2+3.0

TRUE

? SH EQUAL? "  BUTLAST "K

TRUE

? SH EQUAL? [A [B C] ]  [ [B C] A]

FALSE

Note that the empty word, empty list (and also empty image) are distinct objects:

? SH EQUAL? BF "A BF [A]

FALSE


See also related procedures...

WORD?

NUMBER?

LIST?

=

TRUE and FALSE

and other Numeric Operations


Primitive Procedure - ERALL
ERALL   ---   command with no inputs

erase all

ERALL

Erases all memory objects and all turtles, runs a new SLOGO.INI file - if it exists in the Logo home directory. It also clears the graphics screen and resets the whole Logo application (and its screen by running the instruction SETLOGOSIZE [ ] ) as if it had just been started.

After erasing all objects, all settings are changed to their basic values: there will be only one turtle named 0 with its home position [0 0] heading North, it will be hidden, its pen will be down, the Main Window will be in SPLITSCREEN mode, text screen set to 6 lines, and there will be no user-defined objects in the Memory (that is, ERALL erased all objects, even those hidden with the BURY command).


See also related procedures...

ERASE

BURY

NAMES

PROCS

PROPS

ERASETURTLE


Primitive Procedure - ERASE; ER
ERASE; ER   ---   command with 1 or N inputs

ERASE input1

(ERASE  input1  input2 ... )

where each input is either a memory_object or a list_of_memory_objects

Erases all memory objects specified by the inputs.

PROCS, NAMES, and PROPS lists are often used as inputs to ERASE. Remember, that currently buried objects are not members of these lists. However, when named explicitly, they can be erased.

About PROCS, NAMES, and PROPS Lists...

? ERASE NAMES	; erases all variables

? (ERASE [F G] [:V1 V2] PROPS)	; erases procedures F, G, variables V1 and V2,

; and all words with properties

? (ERASE "F ":VAR ""P)	; erases procedure F, variable :VAR and all

; properties of the word "P

If an input to ERASE is not a name of a user-defined object, an ERROR occurs - you can erase only objects which currently exist.

Other alternative:

use Delete in the Memory Window to delete all selected objects


See also related procedures...

ERALL

NAMES

PROCS

PROPS


Primitive Procedure - ERASEFILE; ERFILE
ERASEFILE; ERFILE   ---   command with 1 input

ERASEFILE file

Deletes a file named by the input.

If only partial or no path is specified within the given file name, the current work directory is used to find the proper directory. To understand the rule for finding and setting work directory, see PATH and SETPATH with "PROJECT as the input, and SETLOGO with "AUTOPATH as its input.

If no extension is specified, ERASEFILE adds .LGO

? PL DIR

HIGHWAY.LGP 134276

PIG-HUNTING.LGP 70723

SOMETHIN.LGP 2025

? ERFILE "SOMETHIN.LGP

? PL DIR

HIGHWAY.LGP 134276

PIG-HUNTING.LGP 70723


See also related procedures...

DIR

FILE?

PATH

SETPATH

LOAD

SAVE


Primitive Procedure - ERASETURTLE; ERTURTLE
ERASETURTLE; ERTURTLE   ---   command with 1 input

ERASETURTLE  turtle

ERASETURTLE  list_of_turtles

Erases specified turtles - all of them must exist. Be careful: turtle 0 can be erased as well! To erase a turtle means to remove it from the ALLTURTLES list. To only move it out of the list of active turtles, use TELL.

If turtle 0 is erased, any following DRAW or ERALL commands recreate it with its home position at the point [0 0] and with the basic heading 0 degrees, i.e. to the North. To create a new turtle, use MAKETURTLE.


See also related procedures...

ERALL

MAKETURTLE


Primitive Procedure - ERROR
ERROR   ---   operation with no input
        word with a special meaning

operation:	ERROR

special word:	CATCH "ERROR

When used as an operation, it outputs the complete error message, if an error occurred during a procedure. If no error occurred, the output is [ ].

You can only get the complete error message before the instructions are finished, that is, before control is returned to the top level. (If you used ERROR twice the first ERROR would output an error message, the second ERROR would output [ ].) Therefore, ERROR can only be used with

CATCH "ERROR  list

that is, with CATCH and ERROR used as a word with a special meaning. If ERROR is the first input to CATCH, any error which occurred during the evaluation of the list will be caught here - no error message will be printed and instructions that follow CATCH will specify our own action to any particular error.

TO TRY.IT

CATCH "ERROR [RUN READLIST]	; ERROR as a word

SH ERROR	; ERROR as an operation

END

Try TRY.IT with inputs like SHOW 55 or 55.

If you press function key F12 while instructions are running, Logo stops and shows error number 25 with the text STOP.

  List of Error Messages


See also related procedures...

CATCH

THROW

STOP

TOPLEVEL

MAKEERROR


Primitive Procedure - EXP
EXP   ---   operation with 1 input

EXP number

Outputs the natural base e = 2.718281... raised to the power specified by a number.

? SH EXP -5

0.01

? SH COUNT EXP -5

20	; internal precision is very high
? SETFORMAT 18
? SH EXP 1
2,71828182845904524


See also related procedures...

LN

SETFORMAT

and other Numeric Operations


Primitive Procedure - DIFFERENCE: Advanced Features
DIFFERENCE   ---   advanced features

DIFFERENCE point1  point2

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs the point [a b ], where a is the difference between FIRST point1 and FIRST point2 and b is the difference between LAST point1 and LAST point2. If you consider points to represent directed line segments, point [a b ] is the difference between directed line segments point1 and point2.

? SH DIFFERENCE [20 40] [5 -30]
[15 70]


Primitive Procedure - DIV: Advanced Features
DIV   ---   advanced features

DIV point  number

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point with both components divided by a given number. DIV point number is equivalent to SENTENCE DIV FIRST point number DIV LAST point number.

DIV point1  point2

First component of point1 is divided by the first component of point2, second component of point1 is divided by the second component of point2. DIV outputs the resulting pair of numbers.


Primitive Procedure - DATEWORD; DATEW: Advanced Features
DATEWORD; DATEW   ---   advanced features: 1 or 2 inputs

(DATEWORD  date_format )

(DATEWORD  date_format  date )

The operation can get an optional date_format input that specifies the format with which which Logo will modify the output word. The date_format is a list that uses the following notation:

yyyy 	year 1600 - 3999,
yy 	year 00 to 99,
mmmm 	complete name of the month (January to December),
mmm 	short name of the month (Jan to Dec),
mm 	the number of the month - if necessary, extended by 0 (01 to 12),
m 	the number of the month (1 to 12),
dddd 	complete name of the weekday (Sunday to Saturday),
ddd 	short name of the weekday (Sun to Sat),
dd 	the number of the day - if necessary, extended by 0 (01 to 31),
d 	the number of the day (1 to 31),

'string' 	the string which should appear in the result (without quotes - quotes inside the string must be doubled).

All other characters in the date_format will appear in the result of the DATEWORD operation. Some pre-defined values of the date_format can be used as well:

[ ] 	denotes the standard Windows format "long date",

"  	(empty word) denotes the standard Windows format "short date".

The optional second input date is a date in the form [day month year week_day] or just [day month year]. The DATEWORD operation will output this specified date reformatted into the format specified in the date_format. Weekdays are numbered 0 to 6, 0 is Sunday. If you do not specify the name of the weekday, it is automatically inserted. If the year is between 0 and 99 then Logo adds 1900 to it. Only years 1600 to 3999 are valid (the lower restriction is given by the Gregorian calendar's origin).

? PR (DATEW "dd.mm.yyyy)
21.12.1994
? PR (DATEW ['It''s 'dddd, d of mmmm yyyy])
It's Wednesday 21 of December 1994

? PR (DATEW [ ] [18 5 95]

Thursday, 18 May, 1995

? PR (DATEW " [18 5 95])

18/5/95


Primitive Procedure - EDIT; ED: Advanced Features
EDIT; ED   ---   advanced features - 2 inputs

(EDIT  image_variable  number )

where

number is an integer between 1 and the number of frames in the value of the specified image_variable

If the first input is a variable with an image as its value, the Memory Object Image Editor is started and it opens with the frame you chose in the second input.

? MAKE "Shape GETSHAPE	; this has 24 phases

? (ED ":Shape 17)	; will open the Image Editor

; on the 17th phase


Word with a Special Meaning  - FALSE
FALSE   ---   word with a special meaning

Represents the logical value false or no. It is used as the input to conditional procedures like IF and TEST, and logical operators AND, OR, and NOT.

? SH AND "TRUE "FALSE

FALSE

? SH 6 = 2 + 3

FALSE


See also related procedures...

AND

OR

NOT

TEST

IF

IFFALSE

IFTRUE

TRUE


Primitive Procedure - FILE?
FILE?   ---   operation with 1 input

FILE? word

Outputs TRUE if the file named in word exist . Otherwise the output is FALSE.

If only a partial or no path is specified within the given file name, work directory is used to find the proper directory. To see more about the rules for finding and setting the work directory, see PATH and SETPATH with "PROJECT as the input, and SETLOGO with "AUTOPATH as its input.

If no extension is specified, FILE? adds .LGP.


See also related procedures...

ERASEFILE

LOAD

SAVE

TRUE and FALSE

and other Files Management procedures


Primitive Procedure - FILL
FILL   ---   command with no inputs

FILL

Each active turtle fills its surrounding region with its fill colour and fill pattern, using its filling rules.

To set the fill colour for all active turtles, use SETFILLCOLOUR. Until you use this command, the fill colour is always the current pen colour. To find what the fill colour of the first active turtle is , use FILLCOLOUR. To set the fill pattern for all active turtles, use SETFILLPATTERN. To find what the fill pattern of the first active turtle is, use FILLPATTERN. To set the rules for filling, use SETFILLMODE.

The same settings of both fill colour and fill pattern will be used by POLYGON.


See also related procedures...

PENCOLOUR

SETFILLCOLOUR

SETFILLMODE

SETPENCOLOUR

SETBACKGROUND

DOT

DOTCOLOUR


Primitive Procedure - FILLCOLOUR; FC
FILLCOLOUR; FC   ---   operation with no inputs

FILLCOLOUR

Outputs the colour previously set to be the fill colour of the first active turtle. If no fill colour has been set for a turtle, by default it is the same as its pen colour.

The result of the FILLCOLOUR is the colour to be used by FILL and POLYGON for filling. The fill colour of an active turtle is set either by:

SETFILLCOLOUR, or

any time you set the turtle's pen colour, either with MAKETURTLE - then it is black, or with SETPENCOLOUR.

? MAKETURTLE "PETER [ 0 0 0 ]

? TELL "PETER

? SH FC

0

? SETPC 7

? SH PC

7

? SH FC

7

? SETFC 11

? SH PC

7

? SH FC

11


See also related procedures...

FILL

FILLPATTERN

PENCOLOUR

SETPENCOLOUR

SETBACKGROUND

DOT

DOTCOLOUR

SETFILLMODE

SETFILLCOLOUR

SETFILLPATTERN


Primitive Procedure - FILLPATTERN; FP
FILLPATTERN; FP   ---   operation with no input

FILLPATTERN

Outputs the fill_pattern currently set for the first active turtle. If no filling pattern has been set for a turtle, the default is a solid fill, that is, 0.

The result of this operation is the pattern to be used by FILL and POLYGON for filling. The fill pattern of an active turtle is set with SETFILLPATTERN.


See also related procedures...

FILL

FILLCOLOUR

PENCOLOUR

SETPENCOLOUR

SETBACKGROUND

DOT

DOTCOLOUR

SETFILLMODE

SETFILLCOLOUR

SETFILLPATTERN


Primitive Procedure - FILTER
FILTER   ---   operation with 2 inputs

FILTER  procedural_object  list

where

procedural_object expects 1 input and always outputs either TRUE or FALSE

The operation applies its procedural_object to all members of the list and outputs the list of only those of them that met the condition set in the procedural_object.

? SH FILTER "NUMBER? [AAA 123 B [22 33] C -99]

[123 -99]

? SH FILTER [ [WHAT] [OP :WHAT > 5 ] ] [1 2 3 4 5 6 7 8]

[6 7 8]

? SH FILTER [:% > 5] [1 2 3 4 5 6 7 8]

[6 7 8]


See also related procedures...

BUTMEMBER

FROMMEMBER

MAP


Primitive Procedure - FIRST
FIRST   ---   operation with 1 input

FIRST any

where any is any non empty word, list or image

If the input is a word, FIRST outputs a word containing only its first character. If the input is a list, FIRST outputs its first member. If the input is an image, FIRST outputs an image containing only its first frame.

? SH FIRST "ABC

A

? PR FIRST 99.567

9

? SH FIRST [ [A B C] D E]

[A B C]

? PR FIRST [ [A B C] D E]

A B C

CARS is a variable whose value is an image containing 4 frames. Then:

? SH FIRST :CARS

{image1}	; an image with one frame


See also related procedures...

BUTFIRST

BUTLAST

FPUT

LAST

LPUT


Primitive Procedure - FOR
FOR   ---   command with 3 inputs

FOR  word  [N1  N2 ]  list_of_instructions

FOR  word  [N1  N2  N3 ]  list_of_instructions

where

N1, N2, N3 are numbers, N3 is a step of the repeat

First, let us suppose that N1 < N2. Variable word is initialised to be N1 and the list_of_instructions is carried out. Then the variable word is increased by 1 (if N3 is not specified; otherwise by N3) and the list_of_instructions is carried out again. This process is repeated until the variable word  is bigger than N2.

? FOR "J [1 3] [SH :J]

1

2

3

? FOR "J [1 3 2] [SH :J]

1

3

If N3 - the step - is not specified and N1 > N2, the variable word is decreased by 1 each time. Otherwise N3 is always added to the variable word: if N3 is negative, word decreases each time:

? FOR "JOHN [25 10 -7] [SH :JOHN]

25

18

11

Within the list_of_instructions, REPCOUNT can be used to refer to the actual number of repeats carried out so far. Note also that if N3 is 0, the list_of_instructions is carried out only once. This is also true if N1 = N2.


See also related procedures...

REPEAT

REPCOUNT

MAP

FOREACH

APPLY

WHILE


Primitive Procedure - FOREACH
FOREACH   ---   command with 3 inputs

FOREACH  word  any  list_of_instructions

The first element of any (a character, if it is a word; a member, if it is a list; a frame, if it is an image) is assigned to the variable word and the list_of_instructions is run. Then the second element of any is assigned to the variable word and the list_of_instructions is again carried out, ... etc. for each element of any.

The list_of_instructions is run exactly COUNT any times. That is, if any is empty, the list_of_instructions is not done at all.

Note that within the list_of_instructions you can use REPCOUNT to refer to the actual number of the repeat you are in.

? FOREACH "W [CROCODILE GIRAFFE MONKEY] ~

   [(PR WORD REPC ". "WORD "HAS COUNT :W "LETTERS)]

1. WORD HAS 9 LETTERS

2. WORD HAS 7 LETTERS

3. WORD HAS 6 LETTERS

? MAKETURTLE 1 [20 100 90]

? MAKETURTLE 2 [-50 -50 180]

? FOREACH "TURTLE ALL [ASK :TURTLE [FD 20]]


See also related procedures...

REPEAT

REPCOUNT

MAP

FOR

APPLY

WHILE


Primitive Procedure - FORWARD; FD
FORWARD; FD   ---   command with 1 input

FORWARD number

Moves all currently active turtles the given number of steps (that is, pixels) in the direction they are heading. Depending on the mode PENUP, PENDOWN, PENERASE or PENREVERSE of each turtle's pen it either doesn't draw a line, draws a line (in the currently set colour, width and pattern), erases a line or reverses a line.

If the active turtle is SHOWN?, its shape is displayed before and after the move.

Note that FORWARD 0 means to move ahead 0 steps, that is, a line of the length 1 is drawn. FORWARD 1 means to move ahead 1 step, therefore a line of the length 2 is drawn. Also note:

FORWARD number is the same as BACK -number,

FORWARD 0 is the same as DOT.

? FD 35

? FD -150

TO POLY.SPI :STEP :ANGLE

IF :STEP < 0.5 [STOP]

FD :STEP

LT :ANGLE

POLY.SPI :STEP-3 :ANGLE

END

? POLY.SPI 200 174


See also related procedures...

BACK

HOME

DOT

SETPOS

SETX

SETXY

SETY


Primitive Procedure - FPUT
FPUT   ---   operation with 2 inputs

first PUT

FPUT any  list

FPUT image1  image2

FPUT word1   word2

If the second input is a list, FPUT outputs a modified list whose FIRST member is any and BUTFIRST members are elements of the input list.

If the second input is an image, FPUT outputs a modified image created by joining all frames of the image1 with all frames of the image2. FPUT image1 image2 is the same as IMAGE word1 word2.

If the second input is a word, FPUT outputs a modified word created by joining word1 with word2. FPUT word1 word2 is the same as WORD word1 word2.

? SH FPUT "A [B C D]

[A B C D]

? SH FPUT "A [ ]

[A]

? SH FPUT [ ] [ ]

[ [ ] ]

CARS is a variable whose value is an image containing 4 frames. Then:

? SH FPUT :CARS [44 77]

[ {image4} 44 77]

? SH FPUT :CARS :CARS

{image8}

If the first input is a word and the second is a list of words, FPUT is similar to SENTENCE. For more complex inputs the operations are different.:

? SH SE [1 2] [3 4]

[1 2 3 4]

? SH FPUT [1 2] [3 4]

[[1 2] 3 4]


See also related procedures...

BUTFIRST

BUTLAST

FIRST

LAST

LPUT

REPLACE

SENTENCE


Primitive Procedure - FROMMEMBER
FROMMEMBER   ---   operation with 2 inputs

FROMMEMBER  word1  word2

FROMMEMBER  any  list

The operation finds the left-most instance of the first input - if it exists - in the second input and outputs the part of the second input starting with that instance.

? SH FROMMEMBER "MA "SUBMARINE

MARINE

If both inputs are words, the operation searches word2 from left, character by character, and checks whether it starts with the word1. If it succeeds, the corresponding part of word2 starting with word1 becomes the output. Otherwise, the operation outputs the empty word.

? SH FROMMEMBER "AB "MNCABXYZCAB

ABXYZCAB

? SH FROMMEMBER "ABBA "MABB

; the empty word is returned, because

; ABBA is not a subword of MABB

If the second input is a list, the operation searches for the first member identical (in the sense of EQUAL?) with any and outputs the corresponding part of the list starting with any. If there is no such member, the operation outputs the empty list [ ]:

? SH FROMMEMBER 1 [[1][2][3]]

[ ]

? SH FROMMEMBER [2] [[1][2][3][2][1]]

[[2][3][2][1]]


See also related procedures...

MEMBER

MEMBER?

BUTMEMBER

ITEM

REPLACE


Primitive Procedure - FILL: Advanced Features
FILL   ---   advanced features

There are two possible methods of filling the surrounding region:

to fill an area (surrounding an active turtle) which is bordered by any colour or colours different from the area colour. (The surrounding area can be defined as a continuous area around a turtle where all points have the same colour as the point at the current turtle's position, that is the output of DOTCOLOUR.) Be careful, the area must have no "breaks" in its border or the colour will leak through and fill a larger area or even the whole screen. This method standard in any turtle in Logo, but can be changed with SETFILLMODE. If a turtle's filling method (rule) has been changed, you can set it to the default with SETFILLMODE 0,

to fill an area which is bordered by an active turtle's pen colour. With this rule the area may contain any number of other colours - the whole region is filled. If there isn't such a border on the graphics screen the whole screen is filled. This method can be selected for an active turtle with SETFILLMODE 1.

Any turtle can use either method. If you don't use SETFILLMODE, all turtles use rule 0, which is the same, for example, as the fill in the Paintbrush application.


Primitive Procedure - FOR: Advanced Features
FOR   ---   advanced features

FOR  word  [N1  N2 ]  list_of_instructions

FOR  word  [N1  N2  N3 ]  list_of_instructions

where

N1, N2, N3 are points

Is equivalent to two repetition cycles with one inside the other: first, the repetition is carried out by increasing FIRST word by FIRST N3 (or by 1, if N3 is not specified), then LAST word is increased once by LAST N3 and the inner cycle is repeated ... etc.

? FOR "I [[1 1] [3 3] [0.7 0.9]] [SH :I]

[1 1]

[1.7 1]

[2.4 1]

[1 1.9]

[1.7 1.9]

[2.4 1.9]

[1 2.8]

[1.7 2.8]

[2.4 2.8]


Primitive Procedure - GENERATE
GENERATE   ---   operation with 3 inputs

GENERATE  number  procedural_object2  any

GENERATE  procedural_object1  procedural_object2  any

where

both procedural_objects expect 1 input and procedural_object1 always outputs either TRUE or FALSE

The operation generates and outputs a list in the following: first member of the output list will always be any. Second element is calculated by applying procedural_object2 to the preceding member, that is, to the first member of the list. Third member is worked out by applying procedural_object2 to the second member... etc. This process is repeated until either:

the number of members of the final list equals the specified number,

if procedural_object1 is used instead, it is always applied to the newly generated member. If the result is TRUE, the process goes on. If the result is FALSE, the process is stopped and the last member is not included.

? SH GENERATE 10 [:% + 1] 1

[1 2 3 4 5 6 7 8 9 10]

? SH GENERATE 5 [[X] [OP LIST :X]] [ ]

[[ ] [[ ]] [[[ ]]] [[[[ ]]]] [[[[[ ]]]]] ]

? SH GENERATE [:% > 0] [DIV :% 2] 100

[100 50 25 12 6 3 1]


See also related procedures...

FILTER

MAP

ITEM

SHUFFLE


Primitive Procedure - GETGS
GETGS   ---   operation with no inputs

get graphics screen

GETGS

Outputs a list of four numbers [num1 num2 integer3 integer4 ], which describe the current settings of the graphics screen. Numbers num1 and num2 are always bigger than 7.

Numbers num1 and num2 represent the width and height (in pixels) of the graphics screen. Number num3 is 1 if the graphics screen is currently centred in the Main Window; it is 0 if its upper left corner is located in the upper left corner of the working area of the Main Window. Number num4 is 1 if the scroll bars are displayed at the right and bottom edges of the graphics screen, otherwise it is 0.

Alternatives:

open the Set Screens dialogue box by selecting Options menu Set Screen... in the Main Window. In the dialogue box you see all the settings for both screens,

the same dialogue can be open if you click the right mouse button anywhere in the graphics screen and choose Set Screens... in the pop-up menu.


See also related procedures...

SETGS

GETTS

SETTS


Primitive Procedure - GETIMAGE
GETIMAGE   ---   operation with 1 input

GETIMAGE [ num1  num2  num3  num4 ]

Outputs an image containing only one frame. This image is created (as if taken with a camera) by the first active turtle from its surroundings in the graphics screen.

The list [num1 num2 num3 num4] of four numbers specifies a rectangular region of the graphics screen - relative to the actual position of the first active turtle - which will be copied into the new image. num1 specifies the distance (in pixels) from the position of the first active turtle to the left border of the region, num2 specifies the distance to its top border, num3 to the right border, and num4 to the bottom border. This region must fit completely into the graphics screen. Two first numbers of the input list will also specify the hot spot [num1 num2] of the new image.

The total width and height of the resultant image, that is num1+num3+1 and num2+num4+1 can't exceed 255. The hot spot position (relative to the left top corner of the image) need not be inside the image. Thus, for example, the input [-100 -100 140 160] specifies the region for GETIMAGE - the result will be an image of the size [41 61], with [-100 -100] as its hot spot. GETIMAGE [0 10 0 5] will create an image of the size [1 16] with [0 10] as its hot spot.

Note that shapes of the turtles - neither of the first active one, nor of others - will not be included in the output image unless you first stamp them in the graphics screen with the STAMP.

? SETPW 3 SETPC 12

? REPEAT 4 [FD 10 RT 90]	; small red square

? MAKE "NEW.SHAPE GETIMAGE [1 11 11 1]

? SH :NEW.SHAPE

{image1}	; use Memory Window to inspect it

To change the current shape of a turtle, use the SETSHAPE command:

? SETSHAPE :NEW.SHAPE

? CS

? SETPW 1 SETPC  0 ST

? FD 50

? REPEAT 4 [FD 50 LT 90]

To define transparency in the output image, use SETIMODE.


See also related procedures...

LOADIMAGE

SETIMODE

PUTIMAGE

IMAGE?

SETSHAPE

STAMP


Primitive Procedure - GETSHAPE
GETSHAPE   ---   operation with no inputs

GETSHAPE

Outputs the image which is currently being used as the shape of the first active turtle. If the current shape of the first active turtle consists of more than one frame, all frames - that is the complete image - is returned by the operation.

To assign another shape to all active turtles, use SETSHAPE.

? SH WHO

[0 1 2]

? SH IMAGE? GETSHAPE

TRUE

? MAKE "MY_SHAPE GETSHAPE	; shape of turtle 0

? ASK 2 [SETSHAPE :MY_SHAPE]	; make 2 have the same shape as 0

? ERTURTLE ALL

? MAKE "NEW_SHAPE ASK 2 [GETSHAPE]

MESSAGE: No turtle is active for GETSHAPE


See also related procedures...

SETSHAPE

SAVEIMAGE

MAKETURTLE

LOADIMAGE


Primitive Procedure - GETTS
GETTS   ---   operation with no inputs

get text screen

GETTS

Outputs the number of lines displayed in the text screen, when Logo is in the SPLITSCREEN mode, that is, when both screens are displayed. This number is always an integer between 2 and 25. To change this number, use SETTS.

Alternative:

open the Set Screens dialogue box by choosing Options menu Set Screen... in the Main Window. In the dialogue box you see all the settings for both screens,

the same dialogue can be opened if you click the right mouse button anywhere in the graphics screen and choose Set Screens... in the pop-up menu.


See also related procedures...

SETTS

GETGS

SETGS


Primitive Procedure - GETWINDOW
GETWINDOW   ---   operation with no inputs

GETWINDOW

Outputs an empty list [ ], if the active area (for moving, drawing and printing) of the first active turtle is currently identical with the graphics screen. If you previously redefined the active area for this particular turtle with either WRAP or WINDOW, the GETWINDOW operation outputs the list [X Y w h] listing the active area by its upper left corner [X Y], its width w and its height h.


See also related procedures...

WRAP

WINDOW


Primitive Procedure - GPROP
GPROP   ---   operation with 2 inputs

get property

GPROP  word1  word2

Searches all properties defined for word1 and outputs the value of the property named by word2.

If no property with the name word2 has been defined with PPROP or SETPLIST for word1, the output is an empty list.

? PPROP "FATHER "GERMAN "VATER

? PPROP "FATHER "FRENCH "PERE

? PPROP "MOTHER "GERMAN "MUTTER

? PPROP "MOTHER "FRENCH "MERE

? SH GPROP "MOTHER "FRENCH

MERE

? SH PLIST "FATHER	; find the whole property list

[FRENCH PERE GERMAN VATER]

? SH GPROP "MOTHER "IRISH

[ ]

Alternative:

in the List of Objects of the Memory Window all the names of words with defined properties are listed. These words are recognised by [image] or [image] icons.


See also related procedures...

PPROP

PLIST

SETPLIST

REMPROP

PPS

PROPS

SETPLIST


Primitive Procedure - GRAPHICSCREEN; GS
GRAPHICSCREEN; GS   ---   command with no inputs

GRAPHICSCREEN

Sets the entire Main Window to graphics. The text screen will not be displayed now, but its contents are not lost. The text screen is still active, that is, Logo carries out all instructions typed in from the keyboard.

To display the text screen with its current contents again, use TEXTSCREEN or SPLITSCREEN.

Alternatives:

Window menu Graphics Screen in the Main Window,

F5 function key, if the Main Window is active, or

Graphics Screen Button on the Main Window's Speed Bar.


See also related procedures...

SPLITSCREEN

TEXTSCREEN

SETGS

SETTS

GETGS

GETTS


Primitive Procedure - GREATER?
GREATER?   ---   operation with 2 or N inputs

GREATER? number1  number2

(GREATER? number1  ...  )

GREATER? input1 input2    is the same as    input1 > input2

Outputs TRUE, if number1 is greater than number2. Otherwise the output is FALSE.

If the number of inputs is other than two, GREATER? outputs TRUE, if all the inputs are numbers sorted in decreasing order. Otherwise the output is FALSE.

? SH GREATER? 8 4

TRUE

? SH GREATER? 5 MOD 22 14

FALSE

? SH (GREATER? 8 0 -8)

TRUE


See also related procedures...

LESS?

TRUE and FALSE

and other Numeric Predicates


Primitive Procedure - HEADING
HEADING   ---   operation with no inputs

HEADING

Outputs an angle, which is the heading of the first active turtle.

0 means to the North, with heading increasing clockwise. To change the heading, use either RIGHT, LEFT or SETHEADING.

The basic heading of the default turtle 0 is 0, but it can be redefined (or defined for any new turtle) with MAKETURTLE.


See also related procedures...

LEFT

RIGHT

SETHEADING

TOWARDS


Primitive Procedure - HIDEBUTTONS
HIDEBUTTONS   ---   command with no inputs

HIDEBUTTONS

Hides the Buttons Window from the screen. This is done independently of the actions linked to the buttons - the definitions of buttons are not changed by showing or hiding the Buttons Window itself.

To show the Buttons Window on the screen, use SHOWBUTTONS. To define or redefine the actions of the buttons, use SETBUTTONS. To define the Buttons' Window size, use SETBUTTONSSIZE. To find the current definitions of the buttons, use BUTTONS.

Alternative:

press function key F10


See also related procedures...

SHOWBUTTONS

SETBUTTONS

SETBUTTONSSIZE

BUTTONS


Primitive Procedure - HIDESPEEDBAR
HIDESPEEDBAR   ---   command with no inputs

HIDESPEEDBAR

Hides the Speed Bar of the Main Window from the screen.

When the Speed Bar is hidden, the graphics screen can be made larger (for example, by pressing the Default button in the Set Screens dialogue, see SETGS or SETTS). To specify the exact size of the Logo Main Window, use SETLOGOSIZE.

If you want the Speed Bar displayed on the screen again use SHOWSPEEDBAR.

Alternative:

Window Menu Hide Speed Bar in the Main Window.


See also related procedures...

SHOWSPEEDBAR

HIDEBUTTONS

SHOWBUTTONS


Primitive Procedure - HIDETURTLE; HT
HIDETURTLE; HT   ---   command with no inputs

HIDETURTLE

This command hides all active turtles from the screen.

To make the shapes of all active turtles reappear on the screen, use SHOWTURTLE. To find out whether the first active turtle is currently shown, use SHOWN?. Drawing lines when turtles are shown is much slower. Therefore it is sometimes a good idea to hide all turtles from the screen.

To change the shape of all active turtles, use SETSHAPE with any image as its input.

? ST

? REPEAT 90 [FD 140 RT 172]

? PU

? BK 150

? PD

? HT

? REPEAT 100 [FD 80 RT 176]	; compare the speed of drawing

Alternatives:

grey minus key (on the number keypad) makes all active turtles hidden,

Shift + grey minus key (on the number keypad) makes all turtles hidden, see also About other keys in the Main Window.


See also related procedures...

SHOWN?

SHOWTURTLE

SETSHAPE


Primitive Procedure - HOME
HOME   ---   command with no inputs

HOME

Moves each active turtle to the home position set when the turtle was created with MAKETURTLE.

The actual heading of the turtle is not changed, neither is its pen mode (PU, PD, PE or PX, the pen colour, pattern, or width). Therefore the turtle draws a line when moved home if its pen is down (or reversed). The turtle's shape remains shown, if it was shown before (see SHOWN?). The screen is not cleared.


See also related procedures...

CLEARSCREEN

DRAW


Primitive Procedure - HOTSPOT
HOTSPOT   ---   operation with 1 input

HOTSPOT image

Outputs the list of hot spots [point1 point2 ... ], where point1 is the hot spot of the first frame of the image, point2 is hot spot of the second frame of the image, etc.

If the input image is empty, HOTSPOT will output an empty list [ ].

? TELL 0

? MAKE "X GETSHAPE	; make X contain the basic shape of
; the turtle 0 (normally, the triangle with 24 frames)
? SH HOTSPOT :X
[[7 17][6 16][6 15][4 12][3 9][1 6][0 7][1 6][3 6][4 4][6 3][6 1][7 0][6 1][9 3][12 4][15 6][17 6][17 7][17 6][15 9][12 12][9 15][6 17]]


See also related procedures...

SETHOTSPOT


Primitive Procedure - IF
IF   ---   command with 2 or 3 inputs
      operation with 3 inputs

command:	IF  logical  list1

IF logical  list1  list2

where list1, list2 are lists of Logo instructions

operation:	IF  logical  [ expression1 ]  [ expression2 ]

The IF command and IF operation are distinguished by their second and third inputs. If these are lists of instructions, the whole IF structure is also a command. If the second and the third inputs are expressions giving results after the evaluation, the whole IF also gives a result after its evaluation and therefore is an operation. If IF is used as an operation, neither of its inputs can be an empty list.

The IF instruction must always fit completely in one logical line. If it is a command with only 2 inputs and it is followed by another instruction on the same logical line, you have to enclose the whole IF structure in brackets. To make IF more readable, it is sometimes useful to substitute it with TEST, IFTRUE and IFFALSE.

Command: if the first input is TRUE, instructions in list1 are executed. If the first input is FALSE and there is a third input, list2, instructions in list2 are carried out. If the first input is FALSE and there is no third input, IF has no effect.

TO TRY.1 :NUMBER

IF MOD :NUMBER 2 = 0 [PR "EVEN] [PR "ODD]

END

? TRY.1 22

EVEN

? TRY.1 23

ODD

Operation: Outputs the value of expression1 (that is, the result of evaluating expression1), if the first input is TRUE. Otherwise, the output will be the value of expression2.

TO TRY.2 :NUMBER

OP IF MOD :NUMBER 2 = 0 ["EVEN] ["ODD]

END

? SH TRY.2 22

EVEN

? SH TRY.2 23

ODD


See also related procedures...

IFFALSE

IFTRUE

TEST

TRUE and FALSE


Primitive Procedure - IFFALSE; IFF
IFFALSE; IFF   ---   command with 1 input

IFFALSE  list_of_Logo_instructions

Carries out the instructions in the input list if there is a TEST command above IFFALSE in the same procedure's definition and its output was FALSE. If the output was TRUE, IFFALSE has no effect.

Where to use TEST, IFFALSE, and IFTRUE

TO IS.GOOD? :WHAT

; is :WHAT bigger than 0 and less than 6?

TEST AND (:WHAT < 6) (:WHAT > 0)

IFT [PR [THIS IS THE CORRECT INPUT] ]

IFF [PR [I AM SORRY] ]

END

? IS.GOOD? 6

I AM SORRY

? IS.GOOD? 3

THIS IS THE CORRECT INPUT


See also related procedures...

IF

IFTRUE

FALSE

TRUE

TEST


Primitive Procedure - IFTRUE; IFT
IFTRUE; IFT   ---   command with 1 input

IFTRUE list_of_Logo_instructions

Carries out the instructions in the input list if there is the TEST command above IFTRUE in the same procedure's definition and its output was TRUE. If the output was FALSE, IFTRUE has no effect.

Where to use TEST, IFFALSE, and IFTRUE Procedures

TO IS.GOOD? :WHAT

TEST AND (:WHAT < 6) (:WHAT > 0)

IFT [PR [THIS IS THE CORRECT INPUT] ]

IFF [PR [I AM SORRY] ]

END

? IS.GOOD? 2.66

THIS IS THE CORRECT INPUT

? IS.GOOD? 32

I AM SORRY


See also related procedures...

IF

IFFALSE

TEST

FALSE

TRUE


Primitive Procedure - IGNORE
IGNORE   ---   command with 1 or N inputs

IGNORE  any

(IGNORE  any1  any2 ... )

This procedure gets an input (or inputs) and ignores it.

IGNORE is used in a situation where you get some value from an operation but do not actually need it. For example, you can use it as a simple "stepping tool" through a procedure - the procedure will wait at certain points until you press a key. However, the value of the pressed key is not important here, so you simply ignore it:

TO STEP.POLY :N :S :A

IF :N = 0 [STOP]

FD :S RT :A

IGNORE READKEY

STEP.POLY :N - 1 :S :A

END

? ST STEP.POLY 12 180 150


See also related procedures...

RUN

SHOW


Primitive Procedure - IMAGE
IMAGE   ---   operation with 2 or N inputs

IMAGE image1  image2

(IMAGE image1  ... )

Outputs an image formed by joining all input images. The new image is composed of all frames of all input images. Input images may be empty.

? MAKE "X GETSHAPE	; make X the basic shape

; consisting of 24 frames

? SH :X

{image24}

? SH IMAGE ITEM [1 3] :X ITEM [22 3] :X

{image6}

? SH IMAGE EMPTYIMAGE EMPTYIMAGE

{image0}

? SH :X = IMAGE :X EMPTYIMAGE

TRUE


See also related procedures...

IMAGE?

EMPTYIMAGE

PUTIMAGE

SETSHAPE


Primitive Procedure - IMAGE?
IMAGE?   ---   operation with 1 input

IMAGE? any

Outputs TRUE if the input is an image. Otherwise it outputs FALSE.

? LOADSCREEN "%DEMO\\DELAUNAY.BMP

; loads new contents of the graphics screen,

? MAKE "WHAT GETIMAGE [30 30 30 30]

; creates an image by copying it from there

? SH IMAGE? :WHAT

TRUE

? SH WORD? :WHAT

FALSE

To make a turtle put any image into the graphics screen, use PUTIMAGE. To make a turtle put its own shape into the graphics screen, use STAMP. To save an image in a file, use either SAVEIMAGE or SAVEBITMAP.


See also related procedures...

IMAGE

SETSHAPE

PUTIMAGE

LOADIMAGE

SAVEIMAGE

GETIMAGE

SAVEBITMAP

TRUE and FALSE


Primitive Procedure - IMAGESIZE
IMAGESIZE   ---   operation with 1 input

IMAGESIZE image

Outputs a list of two numbers [X Y] representing the size of the first frame of the given image, where X is its width (in pixels) and Y is its height.

If the IMAGE operation is given an empty image as its input, it will output [0 0].

"PORTRAITS is an image with 5 frames of unequal sizes:

? PR :PORTRAITS

{image5}

? SH IMAGESIZE :PORTRAITS

[51 62]

? PR IMAGESIZE BF :PORTRAITS

[40 57]


See also related procedures...

IMAGE?

GETIMAGE

PUTIMAGE


Primitive Procedure - INC
INC   ---   command with 1 or 2 inputs

increment

INC variable_name

(INC variable_name  number )

Increments the variable named in the input by 1- if the command has only one input. Otherwise, it increments the variable by a given number. The value of the variable must be numeric.

INC "A   is equivalent to   MAKE "A :A + 1

(INC "A 5)   is equivalent to   MAKE "A :A + 5

? MAKE "WHAT 99

? INC "WHAT

? SHOW :WHAT

100

? INC :WHAT

MESSAGE: Variable 100 has no value


See also related procedures...

DEC


Primitive Procedure - INSIDE?
INSIDE?   ---   operation with 1 or 2 inputs

INSIDE?  rectangle

(INSIDE?  point  rectangle )

(INSIDE?  turtle  rectangle )

If the operation has only one input it outputs TRUE if the first active turtle actually lies inside the specified rectangle - or on its border. If the first active turtle actually lies outside the rectangle, the operation outputs FALSE.

If the operation has two inputs and the first one is a point, the output will be TRUE if the specified point lies inside (or on the border of) the rectangle. Otherwise the output is FALSE. If the first input is a name of a turtle, INSIDE? will output TRUE if this particular turtle actually lies inside (or on the border of) the rectangle. This is valid even if the turtle is not active or even if it is not shown, see SHOWN?.


See also related procedures...

OUTSIDE?

OVERLAP?

OVERLAPPED

TRUE and FALSE


Primitive Procedure - INT
INT   ---   operation with 1 input

integer part

INT number

Outputs the integer part of the number, i.e. it outputs the integer which results from truncating any fractional part. Compare with ROUND.

? SHOW INT -34.76565

-34

? SHOW INT EXP 1

2


See also related procedures...

ROUND

DIV

and other Numeric Operations


Primitive Procedure - ITEM
ITEM   ---   operation with 2 inputs

ITEM  number  any

ITEM  segment  any

If the first input is a number, ITEM outputs the number-th member of the second input.

If the second input is a list, the output is its number-th member. If the second input is a word, the output is its number-th character. If the second input is an image, the output is its number-th frame. In all three cases, number must be between 1 and the number of items of any. (If the number is not an integer, its fractional part is first truncated.)

? SH ITEM 3 [A B C D E]

C

? SH ITEM 3 [ [A] [B] [C] [D] ]

[C]

? SH ITEM 4 "Peter

e

? SH ITEM 2.73 [ [aa] [bb] [cc] [dd] ]

[bb]

If the first input is a segment [number1 number2], ITEM outputs a part of any, that is, several consecutive members, characters or frames - starting by the number1th item and containing number2 items.

? SH ITEM [3 4] "FAMOUS

MOUS

? SH ITEM [2 1] [a b c d]

[b]

If the segment's length is zero, like [3 0], the empty list or the empty word or the empty image is returned (depending on the type of any). Number1 in the segment must be between 1 and the number of items of any. However, number2 may exceed  the last item of any:

? SH ITEM [2 5] "JOE

OE


See also related procedures...

FIRST

LAST

COUNT

REPLACE


Primitive Procedure - GREATER?: Advanced Features
GREATER?   ---   advanced features

GREATER? word1  word2

(GREATER? word1  ...  )

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically greater than word2. Otherwise the output is FALSE.

If the number of inputs is other than two, GREATER? outputs TRUE, if all the inputs are words sorted in alphabetically decreasing order. Otherwise the output is FALSE.

GREATER? point1 point2

(GREATER? point ... )

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it is true that GREATER? a c and GREATER? b d. Otherwise the output is FALSE.

If the number of inputs is other than two, GREATER? outputs TRUE, if all the inputs are points sorted in decreasing order (in the way described above). Otherwise the output is FALSE.


Primitive Procedure - INT: Advanced Features
INT   ---   advanced features

INT point

Points represent Directed Line Segments ...

Points can also be compared ...

IF point = [a b ], INT operation outputs a point [m n ], where

m = INT a    and    n = INT b

You can see that INT point is equivalent to SENTENCE INT FIRST point INT LAST point.

? SHOW INT [-233.65 44.12]
[-233 44]


Primitive Procedure - ITEM: Advanced Features
ITEM   ---   advanced features

ITEM [ segment1  segment2 ... ]  any

If several segments are listed, each of them is found separately and all results are put together to form a list, a word or an image:

? SH ITEM [ [2 2] [4 2] ] [A B C D E F]

[B C D E]

? SH ITEM [ [3 3] [2 3] [1 3] ] "FANTASY

NTAANTFAN

In this way, any item of any may appear in the result several times.


Primitive Procedure - IMAGE: Advanced Features
IMAGE   ---   advanced features

IMAGE  image  image_operator

(IMAGE  image  image_operator_expression ... )

The IMAGE procedure can also be used for direct image editing, that is, you can supply the IMAGE procedure with images and certain image_operator_expressions that correspond to all image operations and tools offered by the Image Editor (and sometimes even extend them).

In some of these options IMAGE plays the role of a Logo command - for example, when the foreground colour is specified; in others it plays the role of Logo operation - it outputs new or modified images.

The image_operator_expressions are written in postfix notation (reverse Polish notation), where:

the operands are images, numbers or lists of numbers,

the operators are special words, like Lcolor, Hotspot etc.

The following page lists all possible operators together with their inputs - operands:

colour "Lcolour 	- sets the foreground colour (called left colour or Lcolour) to colour. The colour is a number between 0 and 15, or -1 for transparent colour, or -2 for inverse colour, or a list of three numbers [R B G],

colour "Rcolour 	- sets the background colour (called right colour or Rcolour) to colour. The colour is a number between 0 and 15, or -1 for transparent colour, or -2 for inverse colour, or a list of three numbers [R B G],

b "Raster 	- b is either 0 or 1. Input 1 specifies that the Image Editor will work with dithered colours, 0 specifies that the colours will be solid. For a 16-colour screen driver this setting is always 1,

[x y w h] "New 	- creates and outputs an image with one frame of dimensions [w h] and with the hot spot [x y] (where w means the width and h means the height of the region). The whole image will be covered by Rcolour, that is, the background colour,

[w h] "New 	- is equivalent to [0 0 w h] "New,

image "Replace - in the input image all pixels coloured by Lcolour will be replaced by pixels of Rcolour. The output is the modified image,

image "Reduce - reduces the input image to the smallest possible rectangle by removing all Rcoloured pixels which are at the outer border of the image. This operation can be very slow for big images,

image "Hflip 	- flips the image horizontally. Can be very slow for big images,

image "Vflip 	- flips the image vertically. Can be very slow for big images,

image "Ubutton	- modifies the input image by adding a button-like frame at the image's border. The frame depicts the released button. The width of the frame is defined by the Wbutton setting, see below, or is 2 - if Wbutton has not been set yet. The actual size of the image is not extended,

image "Dbutton	- modifies the input image by adding a button-like frame at the image's border. The frame depicts the pressed button. The width of the frame is defined by the Wbutton setting, see below, or is 2 - if Wbutton has not been set yet. The actual size of the image is not extended,

n "Wbutton	- n is an integer between 1 and 5. This command sets the width of the button's border line for the UButton and Dbutton operations,

image "Clear	- clears the image, that is, covers it with Rcolour,

[face size bold italic] "Font - sets the font for the Text operation in the same way as you specify it in the SETTT command,

[text] "Text	- creates a new image with 1 frame which contains the input text printed in Lcolour. The background is in Rcolour, the hot spot is [0 0],

(image [x y w h] "Copy) - outputs a copy of the specified region from the image (where w means the width and h means the height of the region). If you specify a bigger region than the image itself, the overhanging part is covered with  Rcolour,

(image1 image2 "Put) - puts image2 on top of image1 (unifying their hot spots). The result's size is the size of image1. If Tput is set to 1, the transparent colour of image2 is not copied,

b "Tput	- b is either 0 or 1. Sets Tput for Put (1 is the default),

(image1 image2 "Uput) - similar to Put, however, the size of the result is the minimum rectangle which includes both image1 and image2,

(image number "Resize) - shrinks/grows the image number times. The result is never bigger than 255 x 255 pixels, and is never smaller than 1 x 1 pixels,

(image [w h] "Resize) - shrinks/grows the image to fit into the rectangle [w h] (where w means the width and h means the height of the region),

(image number "Rotate) - rotates the image by number degrees clockwise,

(image number "Tilt) - tilts (slants) the image by number degrees to the right (number is between -45 and 45),

(image [x y] "Hotspot) - defines a new location for the hot spot,

(image [x y] "Fill) - fills the image with Lcolour, starting at the point [x y]. If Dfill is 1, the filling colour spreads diagonally,

b "Dfill	- b is either 0 or 1. Sets Dfill for the Fill operation (0 is the default),

(image [x y w h] "Rectangle) - draws a rectangle with an Lcolour border and Rcolour fill. The upper left corner is specified by [x y], w means the width and h means the height of the rectangle. The width of the border is set by Width. If Rcolour is transparent and Tput is 1, then the rectangle is not filled,

(image [x y w h] "Ellipse) - draws an ellipse with an Lcolour border and Rcolour fill. The ellipse fits into the rectangle [x y w h],

(image [x y w h] "Line) - draws a line in Lcolour. The width of the line is set by Width. The line's initial point is [x y] and its terminal point is identical to the opposite corner of the rectangle [x y w h],

(image [x y] "Getpixel) - outputs the actual colour of a specified pixel. This is either a number between 0 and 15, or a list of three numbers [R G B], or number -1, if the pixel is transparent, or -2, if it is inverse. If the specified position is outside the image, -1 is always returned,

number "Width	- number is an integer between 1 and 5. Sets the width for all drawing operations (1 is the default),

image "Destroy - destroys the image, i.e. deletes it completely from Windows memory. This operation must be used carefully, but it is useful when working with large images.

Some general comments:

All names of operators (except Destroy) can be abbreviated to the 3 leftmost letters (e.g. "lco, "Ubu, "Hot, etc.).

Several image operator expressions can be combined in one IMAGE instruction:

(IMAGE 7 "Rcolour [60 25] "New "UButton [Logo] "Text [-15 -7] "Hot "Put)

This instruction creates an image of 1 frame which is bordered with a grey released button with the text 'Logo' inside.

Processing the above instructions, only the first frames of the input images are processed.


Primitive Procedure - KEY?
KEY?    ---   operation with no inputs

KEY?

Outputs TRUE if any key has been pressed on the keyboard or the left mouse button has been pressed or released. The operation will also output TRUE if the left mouse button is still pressed and the mouse is being dragged. Otherwise it outputs FALSE.

When reading a character from the keyboard, READKEY and READCHAR wait until the output of KEY? is TRUE.

TO YOU.WAIT

IF KEY? [REPORT STOP]

YOU.WAIT 	; this loop is enabled by READCHAR

END

TO REPORT

TYPE [THE INPUT IS:\ ]

PR READCHAR

END

? YOU.WAIT	; waits until you press a key

THE INPUT IS: R

?


See also related procedures...

READCHAR

READWORD

READLIST

READKEY

TRUE and FALSE


Primitive Procedure - LAST
LAST    ---   operation with 1 input

LAST any

where any is any non empty word, list or image

If the input is a word, LAST outputs a word containing only its last character. If the input is a list, LAST outputs its last member. If the input is an image, LAST outputs an image containing only its last frame.

? SH LAST [ [A 56] [B 78] [C 91] ]

[C 91]

? SH LAST LAST [PETER AND PAUL]

L


See also related procedures...

BUTFIRST

BUTLAST

FIRST

FPUT

LPUT


Primitive Procedure - LEFT; LT
LEFT; LT    ---   command with 1 input

LEFT  angle

Makes each active turtle rotate left (that is, counter clockwise) by the set angle (measured in degrees).

To find the heading of the first active turtle, use HEADING.

LEFT angle  is equivalent to RIGHT -angle, see RIGHT.

? LT 90	; the only active turtle is now 0

? SH HEADING

270

? LT -90	; the same as RIGHT 90

? LT 390	; the same as LEFT 30


See also related procedures...

RIGHT

HEADING

SETHEADING

TOWARDS


Primitive Procedure - LESS?
LESS?    ---   operation with 2 or N inputs

LESS? number1 number2

(LESS? number1 ... )

LESS? input1 input2  is the same as  input1 < input2

Outputs TRUE, if number1 is less than number2. Otherwise the output is FALSE.

If the number of inputs is other than two, LESS? outputs TRUE, if all inputs are numbers sorted in increasing order. Otherwise the output is FALSE.

? SH LESS? -4 4

TRUE

? SH LESS? ABS -100 2 * 50

FALSE

? SH (LESS? -7 -4 -1 2 5)

TRUE


See also related procedures...

GREATER?

TRUE and FALSE

and other Numeric Predicates


Primitive Procedure - LET
LET    ---   command with 2 or N inputs

LET  word1  any1

(LET  word1  any1  word2  any2 ... )

Creates a variable word1 or variables word1, word2, ... local to the procedure that uses LET. Unlike LOCAL, however, LET immediately gives values any1, any2, ... to these local variables. Therefore, LET does the same in one step as LOCAL followed by MAKE.

TO TRY.IT

(LET "m 1000 "n SE [1 2 3] [4 5 6] )

(SH :m :n)

END

? TRY.IT

1000 [1 2 3 4 5 6]


See also related procedures...

LOCAL

MAKE

NAME


Primitive Procedure - LIST
LIST    ---   operation with 2 or N inputs

LIST  any1  any2

(LIST  any1 ... )

Outputs a list containing all the inputs as its members. The inputs may be words, lists or images. Note the difference between LIST and SENTENCE.

? SH LIST 4 -6

[4 -6]

? SH LIST "A [B C]

[A [B C] ]

? SH SENTENCE "A [B C]

[A B C]

? MAKE "I.AM "ADDO

? SH (LIST :I.AM "IS :I.AM)

[ADDO IS ADDO]

? SH (LIST)

[ ]	; no inputs, therefore outputs the empty list

Words, lists and images may be mixed together to form more complex lists of items:

? MAKE "Turtle GETSHAPE

? SH (LIST [This is] :Turtle 33 + 17)

[ [This is] {image24} 50]


See also related procedures...

LIST?

SENTENCE


Primitive Procedure - LIST?
LIST?    ---   operation with 1 input

LIST? any

Outputs TRUE if the input is a list. Otherwise the output is FALSE.

? SH LIST? [A B C]

TRUE

? SH LIST? [ ]

TRUE

? SH LIST? FIRST [A B C]

FALSE

? SH LIST? "Joe

FALSE


See also related procedures...

EMPTY?

LIST

SENTENCE

WORD?

IMAGE?

TRUE and FALSE


Primitive Procedure - LN
LN    ---   operation with 1 input

LN number  where number is positive

Outputs the natural logarithm (that is, logarithm to the base e = 2.71828... ) of the input number.

? SH LN 10

2.3

? SH COUNT LN 10

19	; internal precision of the number is very high

? SETFORMAT 18
? SH LN 10
2,30258509299404568


See also related procedures...

EXP

SQRT

SETFORMAT

and other Numeric Operations


Primitive Procedure - LOAD
LOAD    ---   command with 1 input

LOAD LGO_file

Loads and runs all instructions of specified file. The contents of the file is treated as if all its lines were typed in from the keyboard: TO commands are executed to define procedures, MAKE commands are executed to define variables, PPROP commands are executed to define properties and other instructions are carried out in the usual Logo way. If any memory object with the same name already exists, it is redefined (even if it is currently buried).

The file will be searched for in the current work directory (the output of PATH with "PROJECT as its input), or in the directory specified by the complete path within the file name. To understand the rules for setting the work directory, see SETPATH and SETLOGO with "AUTOPATH as its input. To see an alternative way of reading text files, see READFROM.

If no extension is used, .LGO is added. If there is no file with specified name, an ERROR occurs.

If the file loaded was created by saving image variables, it contains lines of the form

MAKE "name LOADIMAGE "* [number1 number2]

Therefore, when being loaded back, LOADIMAGE operation will be carried out by SuperLogo to re-create the original image value of variables.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

APPEND

SAVE

and other Files Management commands


Primitive Procedure - LOADBITMAP
LOADBITMAP    ---   operation with 1 input

LOADBITMAP BMP_file

Outputs an image created from the input bitmap. The output image always contains only one frame.

LOADBITMAP allows you to use any bitmap (created, for example, in Paintbrush) as an image, which can be either placed into the graphics screen with PUTIMAGE, assigned as a value to a variable with MAKE, or assigned to a turtle as its current shape with SETSHAPE. If the original bitmap is bigger than the maximum image, it is reduced to 255 x 255 points starting in its upper left corner. This point also becomes the hot spot of the image, see GETIMAGE. The whole image will be non-transparent. To change this, use the Logo Image Editor.

? MAKE "WHAT LOADBITMAP "%IMAGE\\CAT.BMP

? PR IMAGE? :WHAT

TRUE

? PR :WHAT

{image1}

If the file is specified without any extension, .BMP is added automatically. If the file has no or only a partial path specified, the work directory is used. To understand the rule for finding and setting the work directory, see PATH and SETPATH and SETLOGO with "AUTOPATH as its input. To save the first frame of an image into a file as a bitmap, use SAVEBITMAP.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

SAVEBITMAP

LOADIMAGE

IMAGE?

PUTIMAGE

LOADSCREEN

SAVESCREEN


Primitive Procedure - LOADIMAGE
LOADIMAGE    ---   operation with 2 inputs

LOADIMAGE  LGW_file [ ]

LOADIMAGE  LGW_file  segment

Outputs an image stored in a file.

If this LGW file consists of more frames than you want to load and output with LOADIMAGE, you use segment to specify the part you want: number1 of the segment specifies which frame from the file on the disk will be the first one; number2 specifies how many more frames the output will contain. An empty [ ] input specifies that the whole image saved in the file should be loaded.

If only partial or no path is specified within the given file name, the IMAGE subdirectory of the home directory is used to find the file. To change this setting, use SETPATH with the "IMAGE as its first input. To find the current setting, use PATH with the "IMAGE input.

If no extension is specified, LOADIMAGE adds .LGW. To save an image into the file, use SAVEIMAGE. To attach an image to a turtle as its new shape, use SETSHAPE.

? MAKE "NEW LOADIMAGE "CARS [1 2]

? SH :NEW

{image2}

? SETSHAPE :NEW

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

PUTIMAGE

SAVEIMAGE

GETIMAGE

SETSHAPE

IMAGE?


Primitive Procedure - LOADLIBRARY; LOADLIB
LOADLIBRARY; LOADLIB    ---   command with 1 input

LOADLIBRARY library

Loads the specified library, that is any valid Logo project file and:

extends the contents of the Memory by all memory objects saved within the library. If there is a memory object with the same name both in the Memory and in the loaded library, its previous meaning (value, definition etc.) is lost and redefined by the new contents of the library,

extends the list of turtles by all turtles (together with their complete settings) saved within the library. If there is a turtle with the same name in your current list, the original turtle is erased and completely redefined by the turtle from the library,

all loaded memory objects are immediately buried. To learn more about buried objects, see also BURY, UNBURY, BURIED, BURYALL and SETBURY.

If only a partial or no path is specified within the given library name, the work directory is searched to find this file. To understand the rules for finding and setting the work directory, see PATH and SETPATH and SETLOGO with "AUTOPATH as its input.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

SAVELIBRARY

APPEND

LOAD

LOADIMAGE

BURY

SAVE

and other Files Management commands


Primitive Procedure - LOADPATH
LOADPATH    ---   operation with 1 or 0 input

LOADPATH word

(LOADPATH)

When used with one input, the operation outputs the input word (usually the name of a file) extended by the complete path specifying the directory from where the most recent LOAD command or Open Project... command of the File menu took place.

This operation is used to simplify loading additional files to an initial file or a project. Whenever you want to load another file (for example, another screen) from the same directory from where your project has been loaded, you just say:

? LOADSCREEN LOADPATH "file

The LOADPATH operation can move groups of connected files from directory to directory without worrying about updating paths in all additional loading commands. (However, there is no reason to use LOADPATH if your project doesn't load any additional files.)

When used with no input, LOADPATH outputs the path specifying the directory from where the most recent LOAD command or Open Project... command of the File menu took place.

If no LOAD or Open Project... commands have been used so far, LOADPATH will output the path of the home directory.


See also related procedures...

SETPATH

PATH

LOAD


Primitive Procedure - LOADPROBLEM
LOADPROBLEM    ---   command with 1 or 2 inputs

LOADPROBLEM  TXT_file

Opens the Problem Window and displays in it a problem contained in the chosen TXT file.

If only a partial or no path is specified within the given file name, the PROBLEM subdirectory of the home directory is used to find the proper file. To change this setting, use SETPATH with the "PROBLEM as its first input. To find the current setting, use PATH with the "PROBLEM input.

Note that the LOADPROBLEM command opens the Problem Window immediately even if the HIDEPROBLEMS option of the SETLOGO command is set to 1.


See also related procedures...

CLOSEPROBLEM


Primitive Procedure - LOADSCREEN
LOADSCREEN    ---   command with 1 input

LOADSCREEN BMP_file

Loads the contents of the file into the graphics screen. The file must be a standard bitmap of any size. The width and height of the graphics screen is set to the size of the loaded bitmap. If its size is smaller than the standard settings of the Logo Main Window, the loaded bitmap is placed either at the upper left corner of the screen or is centred in the Main Window according to the current SETGS settings.

LOADSCREEN doesn't change the list of active turtles, or their settings. However, all turtles that are in the WRAP mode, are moved (if necessary) within the graphics screen.

To save the current contents of the graphics screen, use SAVESCREEN. If only a partial or no path is named within the given file name, the SCREEN subdirectory of the home directory is added to find the proper directory. If that subdirectory does not exit, the IMAGE subdirectory is inspected instead. To change this setting, use SETPATH with the "SCREEN as its first input. To find the current setting, use PATH with the "SCREEN input.

If no extension is specified, LOADSCREEN adds .BMP.

  Colour Transformations in Loading and Saving Graphics

Alternative:

Load Screen... command in the Main Window File menu,

corresponding command in the shortcut menu that is opened by the right mouse click in the graphics screen.


See also related procedures...

SAVESCREEN

LOADBITMAP

SAVEBITMAP


Primitive Procedure - LOCAL
LOCAL    ---   command with 1 or N inputs

LOCAL  word1

LOCAL  list_of_words

(LOCAL  word1 ... )

Creates a variable or variables with given names, local to the procedure that gave the LOCAL command. If there are more names or a list of names specified, more local variables are created in one step. Local variables are temporary, they exist only while the procedure that created them is active.

See more about local and global variables

LOCAL can be placed anywhere in the procedure before the local variable is set with MAKE or NAME. LOCAL doesn't set the variable by itself.


See also related procedures...

MAKE

LET

NAME

NAME?

THING


Primitive Procedure - LOGO
LOGO    ---   operation with 1 input

LOGO word

where word is one of the following: ERROR, VERSION, HELP, AUTOPATH, RIGHTCLICKS, STEPPING, DECIMAL, PRINT, SAVE, BEEP or SOUND

Outputs the setting for the option specified by the word. The default value for ERROR is 0, for VERSION is 0, Help is 0, AUTOPATH is 0, RIGHTCLICKS is 1, STEPPING is 0, DECIMAL is comma (,), PRINT is 1, SAVE is 1, BEEP is 1, and SOUND is 1. To see the meanings of these options, see SETLOGO.

? SETLOGO [VERSION 1]
? PR LOGO "VERSION
1


See also related procedures...

SETLOGO


Primitive Procedure - LOGOSIZE
LOGOSIZE    ---   operation with no inputs

LOGOSIZE

Outputs a list [X  Y  w  h  number  text ] of 6 items: the absolute co-ordinates X and Y of the upper left corner of the Logo Main Window, its width and height, its state and finally, its title. To modify any of these settings, use SETLOGOSIZE.


See also related procedures...

SETLOGOSIZE

GETGS

GETTS

SETGS

SETTS


Primitive Procedure - LPUT
LPUT    ---   operation with 2 inputs

last PUT

LPUT any list

LPUT image1 image2

LPUT word1 word2

If the second input is a list, LPUT outputs a modified list whose LAST member is any and BUTLAST members are elements of the input list.

If both inputs are images, LPUT outputs a modified image created by joining all the frames of image2 with all frames of image1. LPUT image1 image2 is the same as IMAGE image2 image1. (Be careful about the order of inputs!)

If the second input is a word, LPUT outputs a modified word created by joining word2 with word1. LPUT word1 word2 is the same as WORD word2 word1. (Be careful about the order of inputs!)

? SH LPUT 5 [1 2 3 4]

[1 2 3 4 5]

? SH LPUT "A [ ]

[A]

? SH LPUT [X Y] [Z W]

[Z W [X Y] ]

? SH LPUT "POSSIBLE "IM

IMPOSSIBLE

CARS is a variable whose value is an image containing 4 frames. Then:

? SH LPUT :CARS LIST BF BF :CARS BF :CARS

[ {image2} {image3} {image4} ]


See also related procedures...

FPUT

BUTFIRST

BUTLAST

FIRST

LAST

REPLACE

WORD


Primitive Procedure - LESS?: Advanced Features
LESS?   ---   advanced features

LESS? word1  word2

(LESS? word1  ...  )

Words can also be compared ...

Outputs TRUE, if word1 is alphabetically less than word2. Otherwise the output is FALSE.

If the number of inputs is other than two, LESS? outputs TRUE, if all the inputs are words sorted in increasing alphabetical order. Otherwise it outputs FALSE.

LESS? point1 point2

(LESS? point1 ... )

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs TRUE, if point1 = [a b ] and point2 = [c d ] and it holds that LESS? a c and LESS? b d. Otherwise the output is FALSE.

If the number of inputs is other than two, LESS? outputs TRUE, if all the inputs are points sorted in increasing order (in the way described above). Otherwise the output is FALSE.


Primitive Procedure - LOADIMAGE: Advanced Features
LOADIMAGE   ---   advanced features

LOADIMAGE  LGW_file  [ segment1  segment2 ... ]

More than one segment can be specified in the second input. In that case, all segments are joined to form one image.

LOADIMAGE  "Clipboard  [ ]

LOADIMAGE  "Clipboard  segment

LOADIMAGE  "Clipboard  [segment1  segment2 ... ]

Loads the contents of the Clipboard and outputs this image. The contents of the Clipboard must be in proper LGW form created, for example, with SAVEIMAGE directed to the Clipboard, or put into the Clipboard with Cut or Copy from the Memory Window.


Primitive Procedure - LOADSCREEN: Advanced Features
LOADSCREEN   ---   advanced features, command with 1 or 2 inputs

(LOADSCREEN  BMP_file  point )

(LOADSCREEN  BMP_file  rectangle )

Sometimes it is useful to load the screen from a file without changing the actual size of the graphics screen. In this way you can compose the screen step by step from several smaller files. To do this you either:

specify a point on the screen and thus define the upper left corner of the region into which the file is loaded. Other regions of the screen are not changed. If the contents of the file is bigger than the region specified by the point and the lower right corner of the Main Window, only a part of the file is loaded and displayed.

specify a rectangle on the screen into which the file is loaded. Other regions of the screen are not changed. If the contents of the file is bigger than the specified region, only a part of the file is loaded and displayed.

LOADSCREEN  screen_of_project

(LOADSCREEN  screen_of_project  point )

(LOADSCREEN  screen_of_project  rectangle )

Any Logo project may contain any number of saved screens. These screens can be loaded by LOADSCREEN. In this case you have to specify which screen should be loaded (with #0 for the basic screen and #1, #2, ... for additional screens) together with the name of the project (where % means home directory):

? (LOADSCREEN "#1Project10.LGP [0 -20] )

? (LOADSCREEN "#4%SUB1\\SUB2\\Project7.LGP [-100 100 50 50] )

Any screen must have been previously saved into the specified project (in the example above, Project10.LGP and Project7.LGP), otherwise an error occurs.

The same effect can be got from the Load Screen... command in the File Menu (or in the shortcut Right Mouse Button Menu), if you choose Logo Project Files (*.lgp) in the List Files of Type box.

LOADSCREEN  "Clipboard

(LOADSCREEN  "Clipboard  point )

(LOADSCREEN  "Clipboard  rectangle )

Loads the current contents of the Clipboard and displays it in the graphics screen. The contents of the Clipboard must be in BMP form created beforehand by, for example, SAVESCREEN directed to the Clipboard, or with the Cut or Copy commands in some other Windows application (like Paintbrush etc.).


Primitive Procedure - LOGO: Advanced Features
LOGO   ---   advanced features

LOGO word

where word can also be one of the following: PICKER, HIGHLIGHT, INDENT, HIDEPROBLEMS, KEEPPALETTE, COMPRESSBMP, CASE, SAVE16, MAXBMPCOLOURBITS, MAXIMAGECOLOURBITS, COLOURBITS or PALETTE

There are some more options which can be specified with SETLOGO and inspected with LOGO. The default value for PICKER is the list of several Logo primitives supported by the graphical choosers, HIGHLIGHT is 1, INDENT is 1, HIDEPROBLEMS is 1, MAXBMPCOLOURBITS is 24, MAXIMAGECOLOURBITS is 4, KEEPPALETTE is 0, COMPRESSBMP is 0, CASE is 0, and SAVE16 is 0. To see the meanings of these options, see the advanced features of the SETLOGO command.

If the input word is COLOURBITS, the operation outputs the number specifying how many bits are being used by the screen driver (1, 4, 8, 24, ... ). If the input word is PALETTE and the screen driver is not using a palette, the operation outputs 0. If the screen driver is using a palette, it outputs 1. These two options, obviously, have no counterpart in SETLOGO, but together with MAXBMPCOLOURBITS and MAXIMAGECOLOURBITS are closely related to the question of Colour Transformations in Loading and Saving Graphics.


Primitive Procedure - LOAD: Advanced Features
LOAD   ---   advanced features

LOAD "Clipboard

Loads and carries out all instructions and definitions of Logo memory objects from the Clipboard. The contents of the Clipboard must be in the correct form created beforehand either by SAVE directed to the Clipboard, or with Copy or Cut from the Logo File Editor, Memory Window or any similar Windows application (Write, Help etc.).


Primitive Procedure - LOADBITMAP: Advanced Features
LOADBITMAP   ---   advanced features

LOADBITMAP "Clipboard

Loads the contents of the Clipboard and outputs an image from it. The contents of the Clipboard must be a bitmap created beforehand either by SAVESCREEN or SAVEBITMAP directed to the Clipboard, or with Copy or Cut from the Logo Image Editor, or any similar Windows application (Paintbrush etc.).


Primitive Procedure - LOADLIBRARY; LOADLIB: Advanced Features
LOADLIBRARY; LOADLIB   ---   advanced features

LOADLIBRARY "Clipboard

If the actual contents of the Windows Clipboard has one of the valid forms for a Logo project (for details see more about the CLIPBOARD operation), you can load it as a library directly from there.

To place the contents into the Clipboard, use either Cut or Copy in the Edit menu of the Memory Window, or SAVELIBRARY.


Primitive Procedure - LOADPROBLEM: Advanced Features
LOADPROBLEM   ---   advanced features

(LOADPROBLEM  TXT_file  input2 )

where input2 is a list of 5 numbers [ num1  num2  num3  num4  num5 ]

The optional second input to LOADPROBLEM is a list of 5 numbers, where

num1 and num2 are the co-ordinates of the window's upper left corner in absolute screen co-ordinates,

num3 and num4 specify how many columns and lines of text can be displayed in the window (i.e. they define indirectly the window's width and height),

num5 is a number with the following values and meanings:

0 - the window can be moved and re-sized,

1 - the window can be moved, but not re-sized,

2 - the window cannot be moved, but can be re-sized,

3 - the window can neither be moved, nor re-sized.

If you have set some or all of the position, size and type information in the first line of the problem (that is, in the TXT file itself), the input2 specification will override it.

By specifying the position and size of the Problem Window and by preventing changing of these settings you can achieve our own screen layout which cannot be modified by the user.


Primitive Procedure - MAKE
MAKE   ---   command with 2 inputs

MAKE word  any

MAKE word any      is equivalent to     NAME any word

Defines a variable named word with the second input as its value.

To find the value of this variable use THING "word or just :word.

? MAKE "A [YOU AND ME]

? SH :A

[YOU AND ME]

? PR :A

YOU AND ME

? SH THING "A

[YOU AND ME]

You can use MAKE to create either global or local variables in the body of any user-defined procedure.

Alternatives:

Add Variable... in the Objects menu of the Memory Window creates a new variable, if there is no variable with the same name,

if there is already a variable with the same name, you can modify its value in the Object Editor of the Memory Window.


See also related procedures...

LOCAL

LET

NAME

THING


Primitive Procedure - MAKEERROR
MAKEERROR   ---   command with 2 inputs

MAKEERROR  list  any

Stops the instructions and declares your own error message. With this command you can define situations in which you want an error to occur. For example, if the input to your procedure XYZ is not an even number.

The error message is put in the list which is the first input to the procedure MAKEERROR:

? MAKEERROR [Incorrect input]  "759

MESSAGE: Incorrect input

The second input any is a value which will become a part of the complete error message, see details on the ERROR operation:

? MAKE "I  333

? CATCH "ERROR [IF :I > 222 [ MAKEERROR [ Too much! ]  :I ] ] SH ERROR

[100 [ Too much! ] [ ] 0 [ ] 333 ]

  List of Standard Error Messages


See also related procedures...

ERROR

CATCH

THROW

DEBUG


Primitive Procedure - MAKETURTLE
MAKETURTLE   ---   command with 2 inputs

MAKETURTLE word  [ ]

MAKETURTLE word  [ number1  number2  number3 ]

MAKETURTLE word  [ number1  number2  number3  ... words  shape ]

where

... words ... are any words from PU, PD, PE, PX, PENUP, PENDOWN, PENUP, PENERASE, PENREVERSE, ST, HT, SHOWTURTLE, HIDETURTLE, TELL, or SETPHASEMODE

shape is either image, "LGW_file or :variable with an image value

A new turtle is created with word as its name and all other inputs specifying its settings.

If the second input is the empty list [ ], the instruction is equivalent to MAKETURTLE word [0 0 0]. If the second input is not empty, the two first numbers [number1  number2 ] set a point that will become the turtle's new home position and number3 defines its basic heading. If there are no more members in the second input, all other settings for this turtle are as follows:

pen colour - 0,

pen width - 1,

pen mode - PENDOWN,

turtle is invisible - HIDETURTLE,

shape of the turtle - basic default shape, to change it later, use SETSHAPE,

turtle text - basic, to change it, use SETTTEXT.

By including other words and a shape in the second input you can set some basic settings:

its pen mode with PU, PD, PE, and PX,

whether it is hidden or shown with ST or HT,

whether it is active - by including the word TELL,

its shape, if a shape is specified.

It is possible to change the basic default shape, if you insert one of the following lines into SLOGO.INI file. In this case, each newly created turtle will have any shape as its actual shape:

ASK [ ] [SETSHAPE ... any shape ... ] 	or

TELL [ ]  SETSHAPE ... any shape ...  TELL 0

When Logo is started, there is only turtle 0 (it is active, see WHO and TELL). Its home position is [0 0] and its basic direction is 0, i.e. it is heading North.

If the turtle word already exists, MAKETURTLE redefines only those settings that are listed in the inputs. The only exception to this rule is that if you do not specify three numbers number1, number2 and number3, its home position and basic direction will always be the Origin [0 0] and the North 0.

The total number of turtles is limited to 4000. A turtle can be erased with ERASETURTLE or ERALL.


See also related procedures...

ALLTURTLES

ASK

EACH

TELL

WHO

ERASETURTLE

ERALL

REORDER

SETSHAPE


Primitive Procedure - MAP
MAP   ---   command with 2 or N inputs
  operation with 2 or N inputs

MAP  procedural_object  list1

(MAP  procedural_object  list1  list2 ... )

where

the number of inputs expected by the procedural_object must be the number of lists list1, list2, ... and all of these lists must have an identical number of elements

All first members of the lists list1, list2, ... are collected into a list and the procedural_object is applied to this list. Then all second members are collected and the procedural_object is applied to them ... etc. for all members of the lists.

If the procedural_object is a command, there is no output from the MAP procedure. Thus, MAP is a command in this case. However, if the procedural_object is an operation, all partial results of applications are collected into a list which then becomes the output of the MAP. In this case MAP is an operation.

? MAP "PR [[Hello] [Ahoy] [Bye]]

Hello

Ahoy

Bye

? SH ( MAP "LIST [1 2 3 4] [A B C D] )

[[1 A] [2 B] [3 C] [4 D]]


See also related procedures...

APPLY

FILTER

FOREACH


Primitive Procedure - MCI
MCI   ---   command (or operation) with 1 input

Media Control Interface

MCI  mci_list

(MCI  mci_list  list )

This procedure is an operation or a command depending on the contents of the mci_list. The input is a list of words and is passed to the MCI interface of Windows which understands it as one "MCI string" command. The language of the MCI strings allow you to manipulate any multimedia device driver which is included in Windows. The strings are described in Microsoft's Multimedia Manual or in other books dealing with multimedia in Windows.

The optional second parameter is a list of Logo commands which have to be carried out when the MCI command completes its work. This is valid only when the mci_list contains the NOTIFY option.


See also related procedures...

PLAY

PLAYWAVE

SOUND

OPENVIDEO

CLOSEVIDEO


Primitive Procedure - MEMBER
MEMBER   ---   operation with 2 inputs

MEMBER  word1  word2

MEMBER  any  list

The operation searches the second input from left to right and tries to find the first input in it. If it succeeds, the operation outputs the position in the second input where it has found the first input:

? SH MEMBER "A "SUBMARINE

5

If the operation fails to find the first input in the second input, it outputs 0.

If the second input is a list, the operation searches for the first member identical (in the sense of EQUAL? condition) to any and outputs the corresponding position (or 0, if it fails):

? SH MEMBER 1 [[1][2][3]]

0

? SH MEMBER [2] [[1][2][3][2][1]]

2


See also related procedures...

MEMBER?

BUTMEMBER

FROMMEMBER

ITEM

FILTER


Primitive Procedure - MEMBER?
MEMBER?   ---   operation with 2 inputs

MEMBER? any  list

MEMBER? word1  word2

Outputs TRUE, if any is a member of the second input - a list. Otherwise outputs FALSE.

If the second input is a word, MEMBER? searches for the first input in the second input as its sub word.

? SH MEMBER? "ABC [A AB ABC ABCD]

TRUE

? SH MEMBER? "ABC [ [A AB ABC ABCD] ]

FALSE	; the list above has only one member

; - that is, the list [A AB ABC ABCD]

? SH MEMBER? [ABC] [ [A] [AB] [ABC] ]

TRUE

? SH MEMBER? "OR "GEORGE

TRUE


See also related procedures...

WORD?

LIST?

EMPTY?

TRUE and FALSE


Primitive Procedure - MESSAGEBOX
MESSAGEBOX   ---   command with 1 or 2 inputs

MESSAGEBOX  text1

(MESSAGEBOX  text1  text2 )

Displays a dialogue box which has a title - set in text2 - and inside the dialogue box is text1 (the message) and an OK button.

Logo pauses the execution of the program and waits until the user presses the OK button or the Enter key. Afterwards it continues with the instructions following the MESSAGEBOX command.

If the command has only one input, the title of the dialogue box is the same as the name of the Main Logo Window. If the command has two inputs and text2 is an empty list [ ], the box has no title.


See also related procedures...

READLISTDIALOG

READLISTTURTLE


Primitive Procedure - MOD
MOD   ---   operation with 2 inputs

MOD number1  number2    where number2 is not 0

Outputs the remainder of integer division of the inputs. Note that the sign of the output is always the same as the sign of number1.

? SH MOD 33 5

3

? SH MOD -33 5

-3


See also related procedures...

DIV

QUOTIENT

and other Numeric Operations


Primitive Procedure - MOUSE
MOUSE   ---   operation with no inputs

MOUSE

When used after the READKEY operation, MOUSE outputs the position [X Y] of the most recent click (or release or drag) by the left mouse button, which has taken place within the graphics screen.

MOUSE is used with READKEY, which outputs 0 if the left mouse button was pressed, and outputs -2, if the left mouse button was released. Thus, clicking the mouse means READKEY outputs either 0 or -2. READKEY outputs -1 if the left mouse button is still pressed and you are moving the mouse, that is, if you are dragging. When READKEY outputs 0 or -2, MOUSE outputs the position, where pressing, or releasing the button took place. When READKEY outputs -1, MOUSE outputs the current mouse position.


See also related procedures...

MOUSESTATE

CODEAREA

READKEY

SETMOUSECURSOR

TOUCHED


Primitive Procedure - MOUSESTATE
MOUSESTATE   ---   operation with no inputs

MOUSESTATE

Outputs a list of 3 members - [Buttons Keys [X Y] ], where Buttons is an integer between 0 and 7. The values mean the following:

0 - no mouse button pressed,

1 - only the left mouse button pressed,
2 - only the right mouse button pressed,
3 - both left and right buttons pressed,
4 - only the middle button pressed,
5 - both left and middle buttons pressed,
6 - both right and middle button pressed,
7 - all three buttons pressed.

The second member of the output list is Keys - an integer between 0 and 3, where:

0 - no special key pressed,

1 - only the Control key pressed,
2 - only the Shift key pressed,
3 - both Control and Shift keys pressed.

The third member is a list [X Y] specifying X and Y co-ordinates of the mouse cursor (even outside of the Logo graphics screen, but always measured from the Origin in the centre of the graphics screen).


See also related procedures...

MOUSE

KEY?

READKEY


Primitive Procedure - NAME
NAME   ---   command with 2 inputs

NAME any word

NAME any word      is equivalent to     MAKE word any

Defines a variable named word with the first input as its value.

To find the value of this variable use THING "word or just :word.

? NAME [YOU AND ME] "A

? PR :A

YOU AND ME

? SH :A

[YOU AND ME]

? SH THING "A

[YOU AND ME]

You can use NAME to create either global or local variables in the body of any user-defined procedure.

Alternatives:

Add Variable... in the Objects menu of the Memory Window creates a new variable, if there is no variable with the same name,

if there is already a variable with the same name, you can modify its value in the Object Editor of the Memory Window.


See also related procedures...

LOCAL

MAKE

NAME?

THING


Primitive Procedure - NAME?
NAME?   ---   operation with 1 input

NAME? word

Outputs TRUE if the word is the name of either:

a global variable (even if it is currently buried with BURY) or,

a local variable of any active procedure, if this variable has already been created with MAKE or NAME or,

an input to any active procedure.

Otherwise the output is FALSE.

? NAME [A B C] "LETTERS

? MAKE "DIGITS [0 1 2 3 8]

? PR NAME? "LETTERS

TRUE

? PR NAME? "NUMBERS

FALSE

Alternative:

if the word is currently not buried with BURY (or if it is made temporarily visible with SETBURY), it is on the list of all memory objects in the Memory Window.


See also related procedures...

NAME

MAKE

LOCAL

THING


Primitive Procedure - NAMES
NAMES   ---   operation with no inputs

NAMES

Outputs the list of all words which are currently names of variables. This list includes:

the names of all global variables created (and not yet erased) by MAKE or NAME. Names of variables that are currently buried by BURY will not be listed unless they are made temporarily visible with SETBURY,

names of all local variables, that is, names of inputs to all currently active procedures; and names of all local variables created with LOCAL and already created with MAKE or NAME.

? MAKE "X 10000

? SH NAMES

[:X]

About PROCS, NAMES, and PROPS Lists...

Alternative:

in the left part of the Memory Window all names of global variables are listed. You can recognise these names by the [image] or [image] icons.


See also related procedures...

NAME?

PROCS

PROPS


Primitive Procedure - NOT
NOT   ---   operation with 1 input

NOT logical

Outputs TRUE if the input is FALSE, or FALSE if the input is TRUE.

? SH NOT "TRUE

FALSE

? SH NOT NUMBER? FIRST "J55

TRUE

? SH NOT 5

MESSAGE: 5 is neither TRUE nor FALSE


See also related procedures and words...

AND

OR

FALSE

TRUE


Primitive Procedure - NUMBER?
NUMBER?   ---   operation with 1 input

NUMBER? any

Outputs TRUE if any is a number, that is, a numeric word. Otherwise the output is FALSE.

? SH NUMBER? 5 + 4.7

TRUE

? SH NUMBER? FIRST [A B C]

FALSE

? SH NUMBER? WORD COUNT "JOHN COUNT "PAUL

TRUE


See also related procedures...

LIST?

WORD?

IMAGE?

TRUE and FALSE


Primitive Procedure - OPENVIDEO
OPENVIDEO   ---   operation with 3 inputs

OPENVIDEO  word1  word2  list3

OPENVIDEO  list1  word2  list3

where word2 is not empty

This operation is used when you want to play any video files (.AVI files, for example). A special MCI command is constructed in OPENVIDEO and immediately acted upon. It is equivalent to the MCI command (SE "OPEN :word1 "ALIAS :word2 ) or (SE "OPEN :list1 "ALIAS :word2 ). If this MCI command is run successfully, its value will become the output of OPENVIDEO itself.

If list3 is not an empty list [ ], then a new window is created according to the settings within this list. If the handle of this new window is to be H, then another MCI command is possible - namely (SE "WINDOW :word2 "HANDLE :H).

The new window is described by the members of the list3. It is a list of three elements [style  text  list], where style is a word which describes the style of the window. It can be one of the following words:

CHILD - the window will be a child window of the graphics screen with no caption and no border,

CHILDBORDER - the window will be a child window of the graphics screen, it will have a border (black line around the window),

CHILDCAP - the window will be a child window of the graphics screen, it will have the border (black line around the window) and a caption (title), the user can drag the window,

OVERLAP - the window will be an overlapped window belonging to the Logo Main Window, it will have a caption and the border. The user can drag the window (and close it with Alt+F4),

OVERSIZE - the window will be an overlapped window belonging to the Logo Main Window, it will have a caption and sizeable frame. The user can drag and resize the window (and close it by Alt+F4),

OVERALL - the window will be an overlapped window belonging to the Logo Main Window, it will have a caption with system menu, minimise and maximise buttons and a sizeable frame. The user can drag, resize, minimise, maximise and close the window.

If you want a style not listed above, you have to refer to the Windows SDK reference manuals. Note that if the style is a child window, its parent will be the graphics screen, otherwise its parent is the Logo Main Window. Note also that Logo always adds WS_visible and ws_clipsiblings to the specified style. If the user is allowed to close the window, this step will also correctly close the associated video file.

The second input, text specifies the title of a video window (if it has a caption).

The third input, list  specifies the position and the size of the video window. It can be either an empty list [ ] or a rectangle. If the size of the window is not specified (for example, by using the list [X Y] for the position only), the size is set to the size of the video itself. This setting is recommended, because the video runs faster in the correctly sized window.

If nothing is specified, the window will begin at the point [0 0] and will be of maximum size. If the style of the window is a child window, the co-ordinates used are the turtle co-ordinates within the graphics screen. If it is not a child window, the co-ordinates are set as the co-ordinates of the whole screen. If the width w and height h are given, it defines the width and height of the client area of the window (i.e. without the borders, captions etc.).

? IGNORE OPENVIDEO 	"C:\\AVI\\MYAVI.AVI ~

"FROG ~

[CHILD [ ] [100 100] ]

? IGNORE OPENVIDEO	[C:\\AVI\\MYAVI.AVI TYPE AVIVIDEO] ~

"FROG ~

[CHILDCAP FROG [100 100] ]

After using OPENVIDEO, the opened video file can be played, stopped, rewound etc. with normal MCI commands that address the alias (the input text). For closing the video file, do not use the MCI CLOSE command, otherwise the video window would not be properly cleared. You must use CLOSEVIDEO.


See also related procedures...

CLOSEVIDEO

MCI

PLAY

PLAYWAVE


Primitive Procedure - OR
OR   ---   operation with 2 or N inputs

OR logical1  logical2

(OR logical ... )

Outputs FALSE if all of the inputs are FALSE. Otherwise, the output is TRUE. If there are more (or less) than two inputs, the whole instruction must be enclosed in brackets.

? SH OR "FALSE "TRUE

TRUE

? SH OR NUMBER? FIRST [[2 3]] NUMBER? LAST [[2 3]]

FALSE

? IF OR EQUAL? 2 3 EQUAL? 4 5 [PR "AAA] [PR "BBB]

BBB


See also related procedures and words...

AND

NOT

TRUE

FALSE


Primitive Procedure - OUTPUT; OP
OUTPUT; OP   ---   command with 1 input

OUTPUT  any

Declares that any will become the output of the currently running operation. OUTPUT can only be used inside a user-defined operation, that is, it distinguishes operations from commands.

An OUTPUT command stops the instructions of the user-defined operation in which it occurs. However it is different from STOP, which stops the procedure but doesn't make it output anything - STOP is used in commands, not in operations.

TO SUM.OF.SQUARES :A :B

OP :A * :A + :B * :B

END

? SH SUM.OF.SQUARES 5  6

61


See also related procedures...

TO

END

STOP


Primitive Procedure - OUTSIDE?
OUTSIDE?   ---   operation with 1 or 2 inputs

OUTSIDE?  rectangle

(OUTSIDE?  point  rectangle )

(OUTSIDE?  turtle  rectangle )

If the operation has only one input, it outputs TRUE, if the first active turtle lies outside the specified rectangle. If the first active turtle lies inside the rectangle or on its border, the operation outputs FALSE.

If the operation has two inputs and the first one is a point, the output will be TRUE if the specified point lies outside the rectangle. Otherwise the output is FALSE. If the first input is the name of a turtle, OUTSIDE? will output TRUE if this particular turtle lies outside the rectangle. This is valid even if the turtle is not active or even if it is not shown, see SHOWN?.


See also related procedures...

INSIDE?

OVERLAP?

OVERLAPPED

TRUE and FALSE


Primitive Procedure - OVERLAP?
OVERLAP?   ---   operation with 1 input

OVERLAP?  turtle

OVERLAP?  list_of_turtles

Outputs TRUE if the first active turtle overlaps the turtle named in the input.

To overlap means that the first active turtle's shape (its actual frame) overlaps the shape of the specified turtle by at least one point. Do not forget that each frame is always a rectangle containing the actual picture - its surroundings may be invisible but belong to the frame.

If the input is a list of turtles, the operation outputs TRUE if the first active turtle overlaps at least one of the turtles specified in the list. Otherwise the operation outputs FALSE.

A turtle never overlaps itself. A turtle which is not SHOWN? never overlaps any turtle, nor is it overlapped by any other turtle. The order of turtles in the ALLTURTLES list has no effect here: overlapping has nothing to do with the "age" of turtles, that is, being above or being below the other turtle in the screen makes no difference.

? TELL 0

? SH OVERLAP? 0

FALSE	; the turtle does not overlaps itself


See also related procedures...

OVERLAPPED

INSIDE?

OUTSIDE?

TRUE and FALSE


Primitive Procedure - OVERLAPPED
OVERLAPPED   ---   operation with no or 1 input

OVERLAPPED

(OVERLAPPED  point )

With no input, OVERLAPPED outputs the list of all turtles that are actually overlapped by the first active turtle.

A turtle never overlaps itself. A turtle which is not SHOWN? never overlaps any turtle, nor is it overlapped by any other turtle. The order of turtles in the ALLTURTLES list has no effect here: overlapping has nothing to do with the "age" of turtles, that is, being above or below the other turtles in the screen makes no difference.

? MAKE "L LOADIMAGE "ABC [1 4]

? MAKETURTLE "A (SE -57 121 ITEM 1 :L)

? MAKETURTLE "B (SE -24 93 ITEM 2 :L)

? MAKETURTLE "C (SE 4 131 ITEM 3 :L)

? MAKETURTLE "D (SE 25 82 ITEM 4 :L)

? TELL [A B C D]

? ST

? EACH [ (SH WHO "overlaps OVERLAPPED) ]

A overlaps [B]

B overlaps [A C]

C overlaps [B]

D overlaps [ ]

If the operation has one input, it outputs the list of all turtles the shapes of which actually overlap the given point.


See also related procedures...

OVERLAP?

INSIDE?

OUTSIDE?


Primitive Procedure - MAKETURTLE: Advanced Features
MAKETURTLE   ---   advanced features - 1 input

 (MAKETURTLE  word )

This alternative is used if the turtle named word already exists and we do not want to change any of its settings (its home position or basic heading). The only thing we do with this instruction is, make turtle word become the youngest turtle of all existing turtles. That is, after Logo does this instruction, turtle word will become the last member of the ALL list. You can do the same with REORDER, however, this instruction is much simpler.

This change is often very important, because the youngest turtle is never overlapped in the screen by any other turtle.


Primitive Procedure - MOD: Advanced Features
MOD   ---   advanced features

MOD point  number

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point with both components reduced by MOD by the given number. Note that MOD point number is equivalent to SENTENCE MOD FIRST point number MOD LAST point number.

MOD point1  point2

where point2 = [c d ] does not contain 0

The first component of point1 is reduced by MOD by the first component of point2, the second component of point1 is reduced by MOD by the second component of point2. MOD outputs the resulting pair of numbers. Note that MOD point1 point2  is equivalent to SENTENCE MOD FIRST point1 FIRST point2  MOD LAST point1 LAST point2.


Primitive Procedure - MESSAGEBOX: Advanced Features
MESSAGEBOX   ---   advanced features - 3rd input

(MESSAGEBOX  text1  text2  parameters )

where parameters has one of the following forms:

[  ]

[X  Y ]

[X  Y  w  h ]

[X  Y  w  h  number1 ]

[X  Y  w  h  number1  colour1  colour2 ]

These optional parameters specify the position, size, frame type and colours of the dialogue box in the following way:

[ ]	sets the default position, size, frame and colours (this is used when we want to revert back to the basic settings, or if we want to set the fourth input without specifying the third one),

[X Y]	defines the position of the dialogue in absolute screen co-ordinates. The size is default. If X, or Y is -32768, then the X, or Y co-ordinate will keep the default value (while the other one is redefined),

[X Y w h]	defines the position and size of the dialogue. If the height h is zero, then the size of the whole dialogue box is set to the size of the edit control plus the border, i.e. there is no place for the question. If either X, Y, width w or height h is -32768, then the appropriate co-ordinate or size will keep the default value,

[X Y w h number1] defines the position, size and frame type of the dialogue, where the values of number1 mean:

0 - default framed dialogue frame (this is the default value),

1 - thin black frame - like a window which cannot be resized,

2 - no frame.

[X Y w h number1 colour1 colour2] defines the position, size, frame type and dialogue box colours. Colour1 is the colour of the box background (default is grey, that is 7), colour2 is the colour of the text (default is obtained from Windows, but it is normally black, that is 0).


Primitive Procedure - PATH
PATH   ---   operation with no or 1 input

PATH

(PATH Logo_subdirectory )

If used with no input, it outputs the complete path of the work directory which was previously set with (SETPATH "PROJECT) or by the latest Open Project... command in the File Menu. PATH with no input is equivalent to (PATH "PROJECT).

When used with the "DEMO input, it outputs the DEMO subdirectory (or PROJECT subdirectory if a DEMO subdirectory does not exist). When used with the "IMAGE input, it outputs the IMAGE subdirectory. When used with the "WAVE input, it outputs the WAVE subdirectory. When used with the "PROBLEM input, it outputs the PROBLEM subdirectory. When used with the "SCREEN input, it outputs the SCREEN subdirectory.

Other alternative:

in the Set path... dialogue box you see the path in the Path box


See also related procedures...

SETPATH

LOAD

SAVE

LOADIMAGE

SAVEIMAGE


Primitive Procedure - PATTERN
PATTERN   ---   operation with no inputs

PATTERN

Outputs the number of the actual pen pattern of the first active turtle.

To change the pen pattern of all active turtles, use SETPATTERN. If no pattern is defined when creating a new turtle with MAKETURTLE, it is set to a solid line.

? SH PATTERN	; this is the default setting

0

? MAKE "P 0

? REPEAT 5 [REPEAT 36 [FD 170 LT 10] INC "P SETPATTERN :P]


See also related procedures...

SETPATTERN

PENCOLOUR

PENWIDTH

SETPENCOLOUR

SETPENWIDTH


Primitive Procedure - PAUSE
PAUSE   ---   command with no inputs

PAUSE

Defines a place in your program to pause a procedure when Logo is in debugging mode. PAUSE has no effect when encountered outside this mode.

TO TRY :I

TYPE :I

PAUSE

TYPE :I + 1

TRY :I + 2

END

? TRY 1

123456789101112131415	; etc. for ever ...

However if you use TRY as an input for DEBUG and press the Finish Active Procedure, Finish All, or Visualise Computation buttons in the Step by Step Window, procedures will always pause at the line following the line with the PAUSE command.

More than one PAUSE can be used in any user-defined procedure. When the procedure is paused in this way, you can use the command line of the text screen to run any Logo instructions etc., or resume the procedure from that point on.


See also related procedures...

DEBUG

STOP


Primitive Procedure - PEN
PEN   ---   operation with no inputs

PEN

Outputs one of the words PU, PD, PE, and PX depending on the mode of the first active turtle, that is, depending on whether its pen is PENDOWN, PENUP, PENERASE or PENREVERSE.

To change the mode of an active turtle's pen, use SETPEN with an input PU, PD, PE or PX, or use PENUP, PENDOWN, PENERASE or PENREVERSE.

? SH WHO

0

? PX	; means PENREVERSE

; pen state of turtle 0 is changed

? SH PEN

PX

? MAKETURTLE "JULIA [40 -20 115]

? ASK "JULIA [SETPEN ASK 0 [PEN] ]	; JULIA's pen is the same as 0's

? ASK "JULIA [SH PEN]

PX

If you want to find more information about the first active turtle's pen in one step, you can use PENSTATE. See also SETPENSTATE.


See also related procedures...

PENDOWN

PENERASE

PENREVERSE

PENUP

SETPEN

PENSTATE

SETPENSTATE

TURTLESTATE


Primitive Procedure - PENCOLOUR; PC
PENCOLOUR; PC   ---   operation with no inputs

PENCOLOUR

Outputs the colour of the first active turtle's pen. You can set the pen colour of all active turtles with SETPENCOLOUR. When a turtle is created with MAKETURTLE, its default pen colour is black - that is, 0.

Note that if the turtle's pen colour is an RGB mixed colour, it will affect the drawings only when the pen width is set to be more than 1, see SETPENWIDTH.

? SH PC

0

? MAKETURTLE 1 [-10 0 0]

? TELL [0 1]

? SETPC 7

? EACH [PR PC]

7

7

To set all information on the turtle's pen in one step, use SETPENSTATE. To find more information about the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

SETPENCOLOUR

PATTERN

PENWIDTH

SETPATTERN

SETPEN

SETPENWIDTH

PENSTATE

SETPENSTATE


Primitive Procedure - PENDOWN; PD
PENDOWN; PD   ---   command with no inputs

PENDOWN

For each active turtle the command puts its pen down. From now on, each active turtle will draw a line (in its colour, width, and pattern) when it moves in the graphics screen.

To change the state of an active turtle's pen, use SETPEN with input PU, PE or PX, or use PENUP, PENERASE or PENREVERSE.

A new turtle created with MAKETURTLE has its pen down, but is not active. To find the current state of the first active turtle, use PEN. CLEARSCREEN command doesn't change the state of any turtle's pen.

? PD	; turtle 0 puts down its pen

? SH PEN

PD

? MAKETURTLE "ELIZA [ ]

? TELL ALL

? PU	; all turtles put their pens up

To set all information on the turtle's pen in one step, use SETPENSTATE. To see all information about the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PENERASE

PENREVERSE

PENUP

PEN

SETPEN

PENSTATE

SETPENSTATE


Primitive Procedure - PENERASE; PE
PENERASE; PE   ---   command with no inputs

PENERASE

Makes each active turtle change its pen's mode so that if it moves in the graphics screen, it will erase (in the pen width) any points that it passes over. To erase a point means to change its colour to the background colour.

To change the state of an active turtle's pen, use SETPEN with input PU, PD or PX, or use PENUP, PENDOWN or PENREVERSE. To find the current state of the first active turtle, use PEN. To modify the background colour, use SETBACKGROUND.

? REPEAT 4 [FD 50 RT 90]

? PE

? REPEAT 4 [FD 50 RT 90]

? SH PEN

PE

? PD

To set all information on the turtle's pen in one step, use SETPENSTATE. To see all information on the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PEN

PENDOWN

PENREVERSE

PENUP

SETPEN

PENSTATE

SETPENSTATE


Primitive Procedure - PENREVERSE; PX
PENREVERSE; PX   ---   command with no inputs

PENREVERSE

Makes each active turtle change its pen mode so that it will reverse (in the pen width) the pen and the background colour when it moves in the graphics screen. This pen state offers many interesting effects which depend on the current combination of the pen colour and background colour.

Try this with the BACKGROUND white and the turtle's pen colour black. First draw in PENDOWN mode, then change the pen state to PENREVERSE, pen colour to white and continue drawing:

? CS GS PD

? SETPW 15 SETPC 0

? REPEAT 300 [FD RANDOM 130 RT RANDOM 360]	; scribbles on the screen

? SETPW 20 SETPC 15	; turns pen colour to white

? PX

? REPEAT 300 [FD RANDOM 130 RT RANDOM 360]

To change the mode of any active turtle's pen, use SETPEN with an input, or PENUP, PENDOWN or PENERASE. To find the current mode of the first active turtle's pen, use PEN.

To set all information on the turtle's pen in one step, use SETPENSTATE. To see all information about the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PEN

PENDOWN

PENERASE

PENUP

SETPEN

SETPENWIDTH

PENSTATE

SETPENSTATE


Primitive Procedure - PENSTATE
PENSTATE   ---   operation with no inputs

PENSTATE

Outputs a list of four pen settings of the first active turtle. The first member of the list is either PD, PU, PE or PX depending on whether the turtle's pen is PENDOWN, PENUP, PENERASE or PENREVERSE. The second member is the pen colour, the third is  the current pen width, and the fourth is the current pen pattern. This operation is used to show PEN, PENCOLOUR, PENWIDTH, and PATTERN settings in one. To change all of these settings in one go, use SETPENSTATE.

? SETPENSTATE [PU 10 6 1]

? SH PENSTATE

[PU 10 6 1]

? PR PEN

PU

? PR PC

10

? PR PW

6

? PR PATTERN

1


See also related procedures...

PATTERN

PEN

PENCOLOUR

PENWIDTH

SETPEN

SETPATTERN

SETPENCOLOUR

SETPENWIDTH

SETPENSTATE


Primitive Procedure - PENUP; PU
PENUP; PU   ---   command with no inputs

PENUP

For each active turtle the command lifts its pen up. Now when turtles move in the graphics screen, they will not draw lines.

To change the state of an active turtle's pen, use SETPEN with input PD, PE or PX, or use PENUP, PENERASE or PENREVERSE.

A new turtle created with MAKETURTLE has its pen down, but is not active. To find the current state of the first active turtle, use PEN. CLEARSCREEN doesn't change the state of any turtle's pen.

TO CHANGE.PEN

IF PEN = "PD [PENUP] [PENDOWN]	 ; if it is down, lift it up

END	; otherwise put it down

TO NEW.POLY :N :SIDE :ANGLE

REPEAT :N [CHANGE.PEN FD :SIDE RT :ANGLE]

END

? NEW.POLY 180 150 142

To set all information on the turtle's pen in one step, use SETPENSTATE. To see all information on the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PEN

PENDOWN

PENERASE

PENREVERSE

SETPEN

PENSTATE

SETPENSTATE


Primitive Procedure - PENWIDTH; PW
PENWIDTH; PW   ---   operation with no inputs

PENWIDTH

Outputs the actual pen width of the first active turtle's pen.

? MAKETURTLE "FAT [ ]	; [ ] here is the same as [0 0 0]

? TELL "FAT

? SETPW 2 * ASK 0 [PW]	; make it twice as wide as 0's


See also related procedures...

SETPENWIDTH

PENSTATE

SETPENSTATE


Primitive Procedure - FRAME
FRAME   ---   operation with no inputs

FRAME

Outputs the number specifying which frame of the first active turtle's shape is currently used to show the turtle. If the turtle is currently shown with the first frame of its shape, for example, the output of the FRAME operation will be 1; if it is shown with the 5th frame, the output will be 5.

If the turtle's shape is an empty image, the FRAME operation will output 0.

The FRAME operation works both when the turtle is shown by SHOWTURTLE or hidden by HIDETURTLE.

How to Use Frames of an Image

? RT 50	; use the basic shape (small triangle)

? PR FRAME

4


See also related procedures...

SETFRAME

SETFRAMEMODE

SETSHAPE


Primitive Procedure - PICK
PICK   ---   operation with 1 inputs

PICK  any

where

any is not empty

The operation outputs a randomly chosen element of the input any.

If the input is a word, PICK outputs its randomly chosen character. If the input is a list, PICK outputs its randomly chosen member. If the input is an image, PICK outputs its randomly chosen frame.

If the input is an empty (word, list or image), an error will occur.

? SH PICK [1 2 3 4 5 6 7 8 9]

8

? SH PICK [1 2 3 4 5 6 7 8 9]

2

Note that PICK any is equivalent to ITEM 1 + RANDOM COUNT any any.


See also related procedures...

ITEM

SHUFFLE


Primitive Procedure - PLAY
PLAY   ---   command with 1 or N inputs

PLAY  list

(PLAY  list1  list2 ... )

Makes the computer's speaker play notes specified by the input lists.

Any of these lists may contain letters as musical notes c d e f g a h plus P for pause and some other symbols with following meaning:

note prefix (number 1, 2, 4, 8 etc.) sets its duration. For example, 1c means a whole note c, 2d means a half note d, 4f means a quarter note f, etc.,

note suffix, where # following a note sets it to a sharp note, b following a note sets it to a flat note, . (point) following a note makes its duration prolonged by 3/2,

letter T followed by an integer sets the tempo in units of quarter notes per minute. Basic setting is T120,

letter O followed by an integer between 0 and 6, inclusive sets the octave. Basic setting is O3. When O# is included in the list, it raises all following notes by one octave, when Ob is included, all following notes are lowered by one octave,

letter L followed by number 1, 2, 4, 8, 16 etc. sets basic note duration for all following notes. If a note has its own number prefix, basic note duration is not used for this particular note. Initial basic setting is L4,

letter R resets all current settings of L, T, and O, and makes them O3, T120, and L4.

Settings specified by L, T, O, and R remain valid for all following PLAY commands unless they are reset by new values or by reset R.


See also related procedures...

SOUND

PLAYWAVE

MCI

OPENVIDEO

CLOSEVIDEO


Primitive Procedure - PLAYWAVE; PLAYW
PLAYWAVE; PLAYW   ---   command with 1 or N inputs

PLAYWAVE  WAV_file

(PLAYWAVE  WAV_file1  WAV_file2 ... )

PLAYWAVE [ WAV_file1  WAV_file2 ... ]

(PLAYWAVE  WAV_file1  WAV_file2 ... [ ] )

(PLAYWAVE  WAV_file1  WAV_file2 ... " )

If you have a sound card installed in our computer (or  it is simulated with SPEAKER.DRV), PLAYWAVE plays the melody encoded in the chosen files. Although there are some important differences between the behaviour of the sound card and Speaker, we will only look at the sound card behaviour.

If the command gets only 1 WAV_file as its input, it starts to play it and immediately continues with the subsequent instructions (while the melody is being played). This, however, is not true if Logo finds another PLAYW command and has to play its input or inputs. If the first melody is still being played, it is stopped and the second PLAYW is played. Therefore, in some situations, instructions

PLAYW "X --- do.something --- PLAYW "Y

may cause a problem. If you want finish the first melody and then play the second and maybe third..., it is possible to put them into one PLAYW instruction of the form (PLAYW "X "Y "Z ... ). In this case Logo plays all of X file, (other instructions are halted), then it plays Y etc. Only when Logo starts to play the last of its WAV inputs, does it also start to run instructions following the PLAYWAVE command.

Note that (PLAYW "X "Y "Z ... ) is equivalent to PLAYW [X Y Z ... ].

If you do not want Logo to continue with instructions until it finishes the last of PLAYW inputs, you can insert, as a kind of empty wave, either an empty word or an empty list as the last wave file to be played. For example, (PLAYW "X "Y "Z " ), or PLAYW [X Y Z [ ]].


See also related procedures...

PLAY

SOUND

MCI

OPENVIDEO

CLOSEVIDEO


Primitive Procedure - PLIST
PLIST   ---   operation with 1 input

property list

PLIST  word

Outputs the property list in the form [name1  value1  name2  value2 ... ] for the given word. The list contains all properties defined for word by PPROP or by SETPLIST (and not removed by REMPROP so far).

? PPROP "FATHER "GERMAN "VATER

? PPROP "FATHER "FRENCH "PERE

? PPROP "MOTHER "GERMAN "MUTTER

? PPROP "MOTHER "FRENCH "MERE

? SH PLIST "FATHER

[FRENCH PERE GERMAN VATER]

? SH PLIST "PERE

[ ]

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, you can modify or erase them as well. Words with properties are indicated by [image] or [image] icons.


See also related procedures...

SETPLIST

GPROP

PPROP

REMPROP

PPS

PROPS


Primitive Procedure - PO
PO   ---   command with 1 input

print out

PO memory_object

PO list of memory objects

Prints on the text screen the definitions of all objects set in the input.

PO also prints out objects that are hidden by BURY. To only print out the title lines of all user-defined procedures, use POTS.

Alternative:

use Memory Window to inspect, create, and modify our own objects.


See also related procedures...

PRINT

PROCS

TEXT

POTS


Primitive Procedure - POLYGON
POLYGON   ---   command with 1 input

POLYGON  polygon_list

Each active turtle prints a filled polygon onto the graphics screen using the input polygon list in the following way:

If the list starts with two numbers s1 s2, then the first of them means to FORWARD s1 and the second one means to RIGHT s2. If following two elements are numbers as well, they are interpreted in the same way, etc. Therefore:

? POLYGON [100 90 100 90 100 90 100 90]

results in a filled square. If s1 is a (non-negative) number and s2 is a polygon list, then the pair means repeat polygon list s2 s1-times. So:

? POLYGON [4 [100 90] ]

results in the same square. The outline of a polygon will be drawn in the pen colour and will be filled with the fill colour and fill pattern.

To set the fill colour for all active turtles, use SETFILLCOLOUR. Until you use this command, the fill colour is always the current pen colour. To find the current fill colour of the first active turtle, use FILLCOLOUR. To set the fill pattern for all active turtles, use SETFILLPATTERN. To find the current fill pattern of the first active turtle, use FILLPATTERN. The same settings of both fill colour and fill pattern will be used by FILL.

By specifying a more complex polygon list you can draw very complex objects (try them):

? MAKETURTLE 0 [0 0 0]

? MAKETURTLE 1 [0 0 180]

? TELL [0 1]

? PU

? SETPC 4

? SETFC 8

? POLYGON [5 [100 144]]

? RT 90

? POLYGON [11 [23 134 39 83 5 [45 99]]]

If the outline of a polygon in a polygon list is not closed (i.e., if it doesn't finish at the same point where it starts), POLYGON will close it by adding one closing line. Therefore, polygon list [100 120 100 120] represents the same polygon as [100 120 100 120 100 120] or [3 [100 120]].

POLYGON always fills the inside of a polygon, which (specially for more complex polygons) is hard to predict.


See also related procedures...

FILL

POLYGONLINE

SETPENCOLOUR

SETFILLCOLOUR

SETFILLPATTERN


Primitive Procedure - POLYGONLINE
POLYGONLINE   ---   command with 1 input

POLYGONLINE  polygon_list

Each active turtle prints a non-filled polygon onto the graphics screen using the polygon list in the following way:

If the list starts with two numbers s1 s2, then the first of them means FORWARD s1 and the second one RIGHT s2. If following two items are numbers as well, they are used in the same way, etc. Therefore:

? POLYGONLINE [100 90 100 90 100 90 100 90]

results in a non-filled square. If s1 is a (non-negative) number and s2 is a polygon list, then the pair repeats polygon list s2 s1-times. Therefore:

? POLYGONLINE [4 [100 90] ]

results in the same non-filled square. The outline of a polygon will be drawn in the pen colour. To change it, use SETPENCOLOUR.

By specifying more complex polygon lists you can draw very complex objects (try them):

? MAKETURTLE 0 [0 0 0]

? MAKETURTLE 1 [0 0 180]

? TELL [0 1]

? PU

? SETPC 4

? POLYGONLINE [5 [100 144]]

? RT 90

? POLYGONLINE [11 [23 134 39 83 5 [45 99]]]

If the outline of a polygon set in a polygon list is not closed (i.e., if it doesn't finish at the same point where it starts), POLYGONLINE will close it by adding one closing line. Therefore, polygon list [100 120 100 120] is the same polygon as [100 120 100 120 100 120] or [3 [100 120]].


See also related procedures...

FILL

POLYGON

SETPENCOLOUR


Primitive Procedure - POS
POS   ---   operation with no inputs

POS

Outputs a point [X Y] representing (in Cartesian co-ordinates) the position of the first active turtle. Note that the Origin of the Cartesian plane is located in the centre of the graphics screen.

To change the current position of all active turtles (that is, by setting a new point [X1 Y1] for them), use either SETPOS, SETX, SETXY or SETY.

? MAKETURTLE "JANE [20 0 90]

? TELL "JANE

? SH POS

[20 0]

? FD 70

? SH POS

[90 0]


See also related procedures...

SETPOS

SETX

SETXY

SETY

XCOR

YCOR


Primitive Procedure - POTS
POTS   ---   command with no inputs

print out titles

POTS

Prints on the text screen the title lines of all user-defined procedures. Title lines of procedures currently hidden by BURY are not printed out, unless they are made temporarily visible by SETBURY "FALSE.

TO FN :X :N

PR SE :X :N

END

TO GREET

PR "HELLO

END

TO FUNNY.THING :A :B :C :D :E :F :G

OP (SE :A :B :C :D :E :F :G)

END

? POTS

TO FN :X :N

TO GREET

TO FUNNY.THING :A :B :C :D :E :F :G


See also related procedures...

PO

PRINT


Primitive Procedure - PPROP
PPROP   ---   command with 3 inputs

put property

PPROP  word1  word2  any

This command defines a new property for word1 set in word2. The value of this property will be the third input any. If word1 already has a property with the given name, its old value is replaced by the new value.

? PPROP "FATHER "GERMAN "VATER

? PPROP "FATHER "FRENCH "PERE

? PPROP "MOTHER "GERMAN "MUTTER

? PPROP "MOTHER "FRENCH "MERE

? SH PLIST "FATHER

[FRENCH PERE GERMAN VATER]

? SH GPROP "MOTHER "FRENCH

MERE

To define all properties for a word in one step, you can use SETPLIST.

Note that the property list for any word is a completely different object from variable with the same name:

? MAKE "FATHER 1000000

? SHOW :FATHER

1000000

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, you can change or erase them as well. Words with properties are shown here with [image] or [image] icons.


See also related procedures...

GPROP

PLIST

SETPLIST

REMPROP

PROPS

PPS


Primitive Procedure - PPS
PPS   ---   command with no inputs

print properties

PPS

Prints all words defined so far together with their properties set with PPROP or SETPLIST (and not removed by REMPROP). Words (and their property lists) which have been buried by BURY, are not printed. PPS is equivalent to PO PROPS. Do not confuse PPS with PLIST.

? PPS	; nothing is printed, because

; no property has been defined

? PPROP "FATHER "GERMAN "VATER

? PPROP "FATHER "FRENCH "PERE

? PPROP "MOTHER "GERMAN "MUTTER

? PPROP "MOTHER "FRENCH "MERE

? SH PLIST "FATHER

[FRENCH PERE GERMAN VATER]

? PPS

FATHER FRENCH is PERE

FATHER GERMAN is VATER

MOTHER FRENCH is MERE

MOTHER GERMAN is MUTTER

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, you can modify or erase them as well. These words are shown by [image] or [image] icons.


See also related procedures...

GPROP

PLIST

SETPLIST

PPROP

PROPS

REMPROP

BURY

BURIED


Primitive Procedure - PRIMITIVE?
PRIMITIVE?   ---   operation with 1 input

PRIMITIVE?  word

Outputs TRUE if the input word is the name of a primitive Logo procedure, that is, if it belongs to the list of initial, basic procedures of Logo. Otherwise, the output is FALSE. Procedures that you define with the TO command, are said to be user-defined and are not primitives.

? SH PRIMITIVE? "ARCTAN

TRUE

TO SQUARE :SIZE	; our own procedure

REPEAT 4 [FD :SIZE RT 90]

END

? SH PRIMITIVE? "SQUARE

FALSE


See also related procedures...

DEFINED?

TO

TRUE and FALSE


Primitive Procedure - PRINT; PR
PRINT; PR   ---   command with 1 or N inputs

PRINT  any

(PRINT  any1  any2 ... )

Prints all specified inputs on the text screen, or into the output file, if the output stream has been redirected by PRINTTO. If there are more than one inputs, they are printed with spaces separating them. PRINT then moves the cursor to the beginning of the next line.

PRINT creates "readable" printing - it removes the outer brackets of lists, compare it with SHOW and TYPE, which is useful when working with the sentences:

? PR "SUPER

SUPER

? (PR "SUPER "LOGO)

SUPER LOGO

? PR [SHORT SENTENCE]

SHORT SENTENCE

? PR [VERY [COMPLICATED [LIST] ] ]

VERY [COMPLICATED [LIST] ]

An image is printed in the form of {imageN}, where N is the number of  phases. To see the image, use the Memory Window.

? MAKE "CARS LOADIMAGE "%IMAGE\\CARS [ ]

? PRINT :CARS

{image5}

Where to Use an Escape Character \


See also related procedures...

SHOW

TYPE

PRINTLINE

PO

PRINTTO


Primitive Procedure - PRINTGRAPHICS; PRINTG
PRINTGRAPHICS; PRINTG   ---   command with 1 or 2 inputs

PRINTGRAPHICS  printer_flag

(PRINTGRAPHICS  printer_flag  rectangle )

Prints the contents of the graphics screen. The settings for printing are in the printer flag.

If the command has only one input, the complete graphics screen will be printed. If you also add the second input, only the chosen rectangle of the graphics screen will be printed.

Alternative:

Print Graphics Screen in the File menu of the Main Window


See also related procedures...

PRINTMEMORY

PRINTTEXT


Primitive Procedure - PRINTLINE; PL
PRINTLINE; PL   ---   command with 1 or N inputs

PRINTLINE any

(PRINTLINE any1 any2 ... )

Prints all listed inputs on the text screen, or to the output file, if the output stream has been redirected there with PRINTTO. Unlike PRINT, PRINTLINE prints each of its inputs on the separate line. If any input is a list, PRINTLINE prints its members on the separate lines too. If the input is a list and any of its members is a list itself, it is printed on one line with the outer brackets removed:

? PL "HOOOO

HOOOO

? PL [MY FUNNY LOGO]

MY

FUNNY

LOGO

? PL [ [FIRST SUBLIST] [AND SECOND SUBLIST] ]

FIRST SUBLIST

AND SECOND SUBLIST

PRINTLINE moves the cursor to the beginning of the next line after printing all its inputs.


See also related procedures...

PRINT

TYPE

SHOW

DIR

PRINTTO


Primitive Procedure - PRINTMEMORY; PRINTM
PRINTMEMORY; PRINTM   ---   command with 1 or N inputs

PRINTMEMORY  printer_flag

(PRINTMEMORY  printer_flag  input1  input2  ... )

where each input is either a memory_object or a list_of_memory_objects

Prints the contents of the Memory Window in the same way as it would print them from the Main Window's File menu by choosing Print from Memory.

If the command has only one input, it prints all memory objects to the printer with its settings in the printer flag. If it has any other inputs, it prints only the selected memory objects.

PROCS, NAMES, and PROPS lists are often used as inputs to PRINTMEMORY. Currently buried objects are not members of these lists - unless they are temporarily made visible with SETBURY "FALSE or Show Also Buried in the Objects menu of the Memory Window.

About PROCS, NAMES, and PROPS Lists...

PRINTM [ ]
(PRINTM "TRUE "X "Y ":V ":P ""Q)
; prints commands X, Y, variables V, P and all
; properties of the word Q
(PRINTM "TRUE [X Y :V :P "Q])
; the same as above but the input is a list

Alternatives:

Print Memory in the File menu of the Main Window,

Print Objects in the File menu of the Memory Window.


See also related procedures...

PRINTGRAPHICS

PRINTTEXT


Primitive Procedure - PRINTTEXT; PRINTT
PRINTTEXT; PRINTT   ---   command with 1 input

PRINTTEXT  printer_flag

Prints the contents of the text screen. The printer and its settings will be those in the printer flag.

Print Text Screen in the File menu of the Main Window


See also related procedures...

PRINTGRAPHICS

PRINTMEMORY


Primitive Procedure - PRINTTO
PRINTTO   ---   command with 1 input

PRINTTO  file

PRINTTO  [ ]

Redirects the output stream to a chosen file, that is, PRINT, PRINTLINE,  SHOW, and TYPE will output to this file instead of into the text screen. If there is no file with the given name, PRINTTO creates it. If it exists, its contents is overwritten.

If only partial or no path is set within the given file name, the current work directory, that is, the output of the expression (PATH "PROJECT) is added to find the proper directory. If no extension is specified, PRINTTO adds .LGO.

All instructions which you type from the keyboard and all ERROR messages are always printed into the text screen (ERROR messages can never be redirected to a file). If you try to print an image, only {imageN} string is printed into the file, where N is its number of frames.

When you enter PRINTTO [ ], the current output file is closed and the output stream is redirected back to the text screen.

Printing To and Reading From a File

Printing To and Reading From a Text Box


See also related procedures...

READFROM

EOF?

PRINT

SHOW

TYPE


Primitive Procedure - PROCS
PROCS   ---   operation with no inputs

procedures

PROCS

Outputs a list of all user-defined Logo procedures. Names of procedures that are currently buried by BURY will not be listed unless they are made temporarily visible with SETBURY.

TO GREET

PR "HELLO

END

TO DO.NOT.GREET

PR "

END

? SH PROCS

[DO.NOT.GREET GREET]

About PROCS, NAMES, and PROPS Lists...

Alternative:

in the List of Objects of the Memory Window all names of user-defined procedures are listed. These procedures are shown with [image] or [image] icons.


See also related procedures...

NAMES

PROPS

NAME?

PRIMITIVE?

DEFINED?


Primitive Procedure - PRODUCT
PRODUCT   ---   operation with 2 or N inputs

PRODUCT number1 number2

(PRODUCT number1 ... )

PRODUCT input1 input2   is the same as   input1 * input2

Outputs the product of the two inputs. For more (or less) than two inputs you have to put the whole instruction into brackets.

? IF 2 * 3 = PRODUCT 2 3 [PRINT "YES] [PRINT "NO]

YES

? SH (PRODUCT 7)

7


See also related procedures...

DIFFERENCE

QUOTIENT

SUM

and other Numeric Operations


Primitive Procedure - PROPS
PROPS   ---   operation with no inputs

properties

PROPS

Outputs a list of all words which currently have some properties associated with them. Names of  words that are currently buried by BURY will not be listed unless they are made temporarily visible with SETBURY.

? PPROP "FATHER "FRENCH "PERE

? PPROP "FATHER "GERMAN "VATER

? PPROP "MOTHER "FRENCH "MERE

? PPROP "MOTHER "GERMAN "MUTTER

? SH PLIST "FATHER	; find the complete property list

[FRENCH PERE GERMAN VATER]

? SH PROPS

["FATHER "MOTHER]

About PROCS, NAMES, and PROPS Lists...

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, and you can modify or erase them as well. These words are shown with [image] or [image] icons.


See also related procedures...

GPROP

PLIST

SETPLIST

PPROP

PPS

REMPROP

NAMES

PROCS


Primitive Procedure - PUTIMAGE
PUTIMAGE   ---   command with 1 input

PUTIMAGE image

PUTIMAGE LGW_file

Each active turtle prints in the graphics screen the first frame of the input image or of the image stored in the input LGW_file.

The hot spot of the first frame of the image is placed at the current position POS of the active turtle - in this way the exact location of the frame in the graphics screen is specified.

When the image is printed by the PUTIMAGE command, it becomes a part of the graphics screen and cannot be moved away - unless the screen itself is cleared. To print the shape of an active turtle, use the STAMP command.

The heading of the active turtle has no effect here: the image is always printed in its normal upright position.

? MAKETURTLE 0 [-20 0 0]

? MAKETURTLE 1 [20 0 0]

? TELL ALL

? PU

? ST

? MAKE "CAR LOADIMAGE "CAR [ ]

? REPEAT 5 [FD RANDOM 100 RT RANDOM 180 PUTIMAGE :CAR]


See also related procedures...

LOADIMAGE

SAVEIMAGE

GETIMAGE

IMAGE?

STAMP


Primitive Procedure - PO: Advanced Features
PO   ---   advanced features

(PO  input1  input2 ... )

where each input is either a memory_object or a list_of_memory_objects

PO command can also be used with N inputs. In this case all definitions of all chosen objects are printed on the text screen.


Primitive Procedure - PRODUCT: Advanced Features
PRODUCT   ---   advanced features

PRODUCT input1 input2
(PRODUCT input1 ... )

where each input is either a number or a point

Points represent Directed Line Segments ...

Points can also be compared ...

All inputs are multiplied from left to right. If two neighbouring inputs are either a point and a number, or a number and a point, the result is a point representing a directed line segment with the same direction. However, its magnitude is multiplied by the number. That is, PRODUCT number point is equivalent to SENTENCE PRODUCT number FIRST point PRODUCT number LAST point.

If two neighbouring inputs are points [a b ] and [c d ], the operation outputs the result of their dot product a*c + b*d.

? SHOW PRODUCT -3 * [15 30]
[-45 -90]

? SHOW (PRODUCT [2 4] [7 20] -2)

-188


Primitive Procedure - PRINTTO: Advanced Features
PRINTTO   ---   advanced features

PRINTTO  "Clipboard

The standard output stream can also be redirected to go directly into the Windows Clipboard. From there it can be pasted into another Windows application, read back into Logo with READFROM and other connected commands etc.


Primitive Procedure - PRINTMEMORY; PRINTM: Advanced Features
PRINTMEMORY; PRINTM   ---   advanced features

PRINTMEMORY  printer_flag  input1  input2  ...

where each input is either a memory_object or a list_of_memory_objects

Note that no brackets are needed when PRINTMEMORY has N inputs.

The group of Logo primitive procedures with the same property mentioned above consists of the procedures APPEND, SAVE, SAVELIBRARY and PRINTMEMORY.

Hence, PRINTMEMORY must be the last command on the line (otherwise Logo would consider each expression till the end of the line to be its input).

PRINTM "TRUE "X "Y ":V ":P ""Q
; prints commands X, Y, variables V, P and all
; properties of the word Q
PRINTM "TRUE [X Y :V :P "Q]
; the same as above but the input is a list


Primitive Procedure - QUOTIENT
QUOTIENT   ---   operation with 2 inputs

QUOTIENT number1 number2

QUOTIENT input1 input2   is the same as   input1 / input2

Outputs number1 divided by number2. Division by zero causes an ERROR. Note the difference between QUOTIENT and DIV, which outputs the integer division of its inputs.

? SH QUOTIENT 555555 32

17361.09

? SH DIV 555555 32

17361


See also related procedures...

DIV

MOD

and other Numeric Operations


Primitive Procedure - RANDOM
RANDOM   ---   operation with 1 input

RANDOM  number

where

number is not negative

Outputs a random integer between 0 and number-1, inclusive. (If the input number is not integer, it is rounded first.) For example, the output from RANDOM 5 is 0, 1, 2, 3 or 4.

? REPEAT 4 [PRINT RANDOM 5]

0

2

0

1


See also related procedures...

RANDOMIZE

and other Numeric Operations


Primitive Procedure - RANDOMIZE
RANDOMIZE   ---   command with no inputs

RANDOMIZE

Initialises the build-in random number generator with a random value obtained from the system clock.

If you start Logo twice in succession and run (as the first instruction) SH RANDOM  5, you obtain the same output - the random number generator in fact always starts from the same value. (This feature is sometimes useful in the debugging stage of developing your programs.) RANDOMIZE "randomly" changes the starting value of the random number generator, so that:

? RANDOMIZE

? SH RANDOM  5

will generate different random numbers whenever Logo is started.


See also related procedures...

RANDOM

and other Numeric Operations


Primitive Procedure - READCHAR; RC
READCHAR; RC   ---   operation with no inputs

READCHAR

Outputs a character typed in from the keyboard. If no character has been typed (that is, if no key has been pressed), READCHAR waits for it. (it waits until KEY? outputs TRUE). The character typed in is not printed on the screen.

If the input stream has been redirected by READFROM to come from a file, the output of READCHAR will be the next character of the actual line of the file.

? SH RC	; press A

A	; A is displayed by SHOW, not by READCHAR

? SH (SE RC RC RC RC RC)	; press H, E, L, L, O

[H E L L O]

If you press any of the control keys (arrows, Insert, Delete, Home, End, PgUp, and PgDn), the READCHAR output will be CHAR 0 and you have to involve READCHAR once more to find the code itself. Compare it carefully with READKEY.

? IF RC = CHAR 0 [SH  ASCII RC]	; press Delete

83

Printing to and Reading from a File

Printing To and Reading From a Text Box


See also related procedures...

READLIST

READWORD

KEY?

READFROM


Primitive Procedure - READFROM
READFROM   ---   command with 1 input

READFROM  file

READFROM  [ ]

Redirects the standard input stream to come from a chosen file, that is, to tell READCHAR, READWORD, and READLIST to read from this file instead of from the keyboard. If there is no file with that name, an ERROR occurs.

? READFROM "FILE55

MESSAGE: I didn't find file FILE55

If only partial or no path is specified within the given file name, the current work directory, that is, the output of the expression (PATH "PROJECT) is added to find the directory. If no extension is specified, READFROM adds .LGO.

If the last data in the file has already been read (that is, the last line by READLIST or the last word by READWORD or the last character by READCHAR), the output of the EOF? predicate will be TRUE.

To redirect the input stream to come from the keyboard again, you have to enter READFROM [ ].

Printing To and Reading From a File

Printing To and Reading From a Text Box


See also related procedures...

EOF?

PRINTTO

READCHAR

READLIST

READWORD


Primitive Procedure - READKEY
READKEY   ---   operation with no inputs

READKEY

Outputs the numeric ASCII code corresponding to the key pressed on the keyboard. If no key has been pressed, READKEY waits for it. (it waits until KEY? predicate outputs TRUE). The character typed in is not shown on the screen.

? SH SE READKEY READKEY	; press b and B

[98 66]

READKEY outputs "special values" if you press any of the selected control keys or if you click the left mouse button:

it outputs 9, 27, 13, 8, if you press Tab, Esc, Enter and BackSpace key respectively,

it outputs -72, -75, -77, -80, if you press an arrow key (up, left, right, and down respectively),

it outputs -115, -116, -117, -118, if you press Ctrl+left arrow, Ctrl+right arrow, Ctrl+up arrow, Ctrl+down arrow respectively,

it outputs -71, -79, -73, -81, -82, -83, if you press Home, End, PgUp, PgDn, Insert, and Delete respectively,

it outputs 1, 2, ... 26, if you press Ctrl+A, Ctrl+B, ... Ctrl+Z respectively (except Ctrl+C, Ctrl+V, Ctrl+X, Ctrl+K),

if you set FKEYS to 0 with SETLOGO, READKEY will output -59, -60, ... -69, if you press F1, F2, ..., F11 function keys. If you set FKEYS to 12, READKEY will output -70 when F12 is pressed,

it outputs 0 if the left mouse button was pressed (only in the graphics screen) and -2, if the left mouse button was released. Thus, clicking the mouse means READKEY outputs either 0 or -2. READKEY outputs -1, if the left mouse button is still pressed and you are moving the mouse, that is, if you are dragging. Here you can make use of the MOUSE operation: When READKEY outputs 0, or -2, MOUSE outputs the position, where pressing or releasing the button took place at that moment. When READKEY outputs -1, MOUSE outputs the mouse position.

READKEY works with CODEAREA - it outputs codes defined by CODEAREA properties.

? IF READKEY = -79 [PR [This is the End key] ]	;  press End

This is the END key

READKEY can never be redirected by READFROM to read from a file, which makes it different from READCHAR. Even when you are reading from a file, you can use READKEY to read codes coming from the keyboard.


See also related procedures...

CHAR

READCHAR

READWORD

READLIST

MOUSE

CODEAREA


Primitive Procedure - READLIST; RL
READLIST; RL   ---   operation with no inputs

READLIST

Logo first prints a readlist prompt followed by a space on the text screen and waits until you type anything and press Enter. READLIST encloses all that you have typed into brackets and outputs it as a list:

? SH READLIST

: ONLY TWO WORDS	; this is what you type

[ONLY TWO WORDS]	; this is the output

? SH READLIST

: VERY [STRANGE [STRUCTURE] ]	; this is what you type

[VERY [STRANGE [STRUCTURE] ] ]	; this is the output

(Be sure that you understand the difference between SHOW and PRINT.)

? MAKE "P READLIST

: PRINT "HELLO	; this is what you type

? SH :P

[PRINT "HELLO]

? RUN :P

HELLO	; see RUN

If the input stream has been redirected by READFROM to come from a file, the output of READLIST will be the rest of the line in the form of a list. Be careful: If the entire Main Window is in the "graphics screen only" mode and the READLIST operation is being used, the readlist prompt is not visible, but Logo is still waiting for your input.

Printing to and Reading from a File

Printing To and Reading From a Text Box


See also related procedures...

READCHAR

READKEY

READWORD

READFROM

READLISTDIALOG

READLISTTURTLE

SETREADLISTPROMPT


Primitive Procedure - READLISTDIALOG; RLD
READLISTDIALOG; RLD   ---   operation with no, 1 or 2 inputs

READLISTDIALOG

(READLISTDIALOG  text1 )

(READLISTDIALOG  text1  text2 )

A dialogue box (optionally with a question and a title) is displayed. Inside the dialogue box there is an edit box and an OK button. The user can type into the edit box and press Enter or push the OK button. The text written into the edit box is passed to Logo as a list and forms the output of the READLISTDIALOG operation.

If the operation has no input, there will be no question (text) inside it. Otherwise, text1 contains the question. If the operation has no or only 1 input, the dialogue will be named SuperLogo. Otherwise, text2 specifies the title. An empty list as an input is equivalent to no text.

If the input is not a correct list (e.g. it has more closing brackets than opening ones, like in [a] ]), the dialogue will not close. Instead, it beeps and requires you to correct the input.

? SH (RLD [ ] [Question1] )

will open a dialogue with no question. Its title will be Question1.


See also related procedures...

READLISTTURTLE

SETREADLISTPROMPT


Primitive Procedure - READLISTTURTLE; RLT
READLISTTURTLE; RLT   ---   operation with no inputs

READLISTTURTLE

An edit box is displayed at the position of the first active turtle (the edit box is centred on the position of the turtle). Logo then waits until the user types some text in the edit box and presses Enter. The edit box then closes and the typed text forms the result of the READLISTTURTLE operation.

The Edit box always has a single frame and its colours depend on the actual pencolour and fillcolour of the first active turtle. (If these colours are different, then the text in the control is in the pencolour and its background is in the fillcolour. If they are equal, then the background colour is the default Windows background colour (usually white) and the text is in the actual pencolour.)


See also related procedures...

READLISTDIALOG

READLIST

READCHAR

READKEY

READWORD


Primitive Procedure - READWORD; RW
READWORD; RW   ---   operation with no inputs

READWORD

Logo first prints a readlist prompt followed by a space in the text screen and waits until you type in a word and press Enter. The output of the READWORD operation will be this word. If you type in more than one word (before pressing Enter), READWORD outputs only the first of them.

? MAKE "YOUR.NAME RW

: FRED

? SH :YOUR.NAME

FRED

If the input stream has been redirected by READFROM to come from a file, the output of READWORD will be the next word of the actual line of this file. If the first character in the input stream starts with the left bracket [, the output of READWORD operation is the whole list.

Be careful: If the entire Main Window is in the "graphics screen only" mode and the READWORD operation is being used, the READWORD prompt is not visible, but Logo is still waiting for your input.

Printing to and Reading from a File

Printing To and Reading From a Text Box


See also related procedures...

READCHAR

READKEY

READLIST

READFROM

READLISTDIALOG

SETREADLISTPROMPT


Primitive Procedure - REMPROP
REMPROP   ---   command with 2 inputs

remove property

REMPROP  word1  word2

Removes the property with the name word2 from the property list of word1.

? PPROP "FATHER "FRENCH "PERE

? PPROP "FATHER "GERMAN "VATER

? SH PLIST "FATHER	; find the complete property list

[FRENCH PERE GERMAN VATER]

? REMPROP "FATHER "FRENCH

? SH PLIST "FATHER

[GERMAN VATER]

All properties, that is the whole property list of a word can be removed in one step with ERASE ""word or ERASE ["word ] - see the following:

About PROCS, NAMES, and PROPS Lists...

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, you can modify or remove them as well. Words with properties are shown here with [image] or [image] icons.


See also related procedures...

GPROP

PLIST

SETPLIST

PPROP

PPS

PROPS

ERASE


Primitive Procedure - REORDER
REORDER   ---   command with 1 input

REORDER  list_of_turtles

Reorders both the list of all turtles, that is, the ALLTURTLES list, and the list of all active turtles, that is, the WHO list. If the input list is [turt1 turt2 ... turtN] and all its members are either active or non-active turtles, turt1 will become the first member of the ALLTURTLES list, turt2 the second one, etc. First turtle which is currently active among turt1, ... turtN , will become first member of the WHO list as well, i.e., it will become the first active turtle.

If the REORDER input list  doesn't contain all existing turtles, those not included keep their order in the ALLTURTLES and WHO lists except that they are shifted to the right (or 'down').

Remember that:

many Logo commands make use of the first active turtle,

TOUCHED makes use of the youngest turtle. The "age" of turtles also defines the "order of turtles' shapes" when they overlap on the screen, i.e. it defines, which turtle will be behind the others.

REORDER changes the order of turtles, that is, it defines which turtle will show above others when moving around the graphics screen. This can help you achieve nice animation effects,

Assume that there are 5 turtles, two of them are active:

? SH ALL

[0 1 2 3 4]	; all of them

? SH WHO

[1 3]	; those are active

? REORDER [3 4 2]

? SH ALL

[3 4 2 0 1]	; now 1 is the youngest

? SH WHO

[3 1]	; now, 3 is the first active


See also related procedures...

MAKETURTLE

ALLTURTLES

WHO

TOUCHED


Primitive operation - REPCOUNT; REPC
REPCOUNT; REPC   ---   operation with no inputs

REPCOUNT

Can only be used inside REPEAT, FOR, WHILE and FOREACH. It outputs a positive integer, which tells you how many times the particular REPEAT command has already been round  its loop (including this one):

? REPEAT 3 [PR REPC]

1

2

3

REPCOUNT behaves like a variable which is always increased by 1 in the body of REPEAT.


See also related procedures...

REPEAT

FOR

WHILE

FOREACH

RUN

EACH

IF


Primitive Procedure - REPEAT
REPEAT   ---   command with 2 inputs

REPEAT  number  list_of_Logo_instructions

Evaluates the list of instructions repeatedly a given number of times. If the first input to REPEAT is less than 1, the list of instructions is not run at all. If the number is not an integer, its fractional part is truncated first. REPEAT can be used within another REPEAT, etc.

? REPEAT 3 [PR "HELLO]

HELLO

HELLO

HELLO

? MAKE "A 4

? MAKE "B [FD 120 REPEAT 4 [FD 15 LT 90] RT 90]

? REPEAT :A [REPEAT 10 [RUN :B RT 1.5] ]

It is often very useful to use the REPCOUNT operation inside the list of instructions to check the number of repeats already done (including this one).


See also related procedures...

FOR

FOREACH

WHILE

RUN

EACH

IF

REPCOUNT


Primitive operation - REPLACE
REPLACE   ---   operation with 3 inputs

REPLACE  number  list  any

REPLACE  number  word1  word2

REPLACE  number  image1  image2

REPLACE  segment  list1  list2

REPLACE  segment  word1  word2

REPLACE  segment  image1  image2

If the first input is a number, REPLACE outputs its second input with the number-th item replaced by the third input.

? SH REPLACE 2 [A B C D] 1000

[A 1000 C D]

? SH REPLACE 2 "TREE "HR

THREE

Number must be between 1 and the number of items of the second input. (If the number is not an integer, its fractional part is truncated.)

If the first input is a segment [number1 number2], REPLACE outputs its second input modified by replacing the chosen segment of consecutive members, characters or frames (starting by the number1-th item and containing number2 elements) by the third input. Note that the third input is always of the same type as the second input.

? SH REPLACE [3 2] "HELLO "R

HERO

? SH REPLACE [2 4] [A B C D E F] [X Y]

[A X Y F]

? SH REPLACE [2 4] [A B C D E F] "WRONG

MESSAGE: replace doesn't like WRONG as its input

? SH REPLACE [2 4] [A B C D E F] [WRONG]

[A WRONG  F]

REPLACE with a segment as its first input makes it possible to remove several items from the second input, or to insert new items into it:

? SH REPLACE [1 0] [a b c] [10 20 30]

[10 20 30 a b c]

? SH REPLACE [3 0] "ABCDEF "XYZ

ABXYZCDEF

; [3 0] this means: starting right before the 3rd member

; while [3 1] would mean: starting right before the 3rd member and

; including one member

? SH REPLACE [2 3] [a b c d e f] [ ]

[a e f]


See also related procedures...

ITEM

FPUT

LPUT


Primitive Procedure - RESETPALETTE;  RESETPAL
RESETPALETTE; RESETPAL   ---   command with no inputs

RESETPALETTE

If you work in a 256 colour mode and load 256 colour bitmaps, you should use this command before loading each bitmap, especially if you know that the bitmap you are going to load might use a different palette of 256 colours.

Whenever Logo is asked to run the ERALL command, or whenever you choose the File Menu New Project command, the RESETPALETTE command is run first.


See also related procedures...

ERALL


Primitive Procedure - RIGHT; RT
RIGHT; RT   ---   command with 1 input

RIGHT angle

Makes each active turtle rotate right (that is, clockwise) by the specified angle (measured in degrees).

To find the heading of the first active turtle, use HEADING.

RIGHT angle  is equivalent to LEFT  -number, see also LEFT.

? RT 90	; let the only active turtle be 0

? SH HEADING

90

? RT -90	; is the same as LEFT 90

? RT 380	; is the same as RIGHT 20


See also related procedures...

LEFT

HEADING

SETHEADING

TOWARDS


Primitive Procedure - ROUND
ROUND   ---   operation with 1 input

ROUND number

Outputs the nearest integer to the input number.

Note the difference between ROUND and INT, which doesn't round its input but removes its fractional part.

? SH ROUND 7.72

8

? SH ROUND -55.5

-56


See also related procedures...

INT

and other Numeric Operations


Primitive Procedure - RUN
RUN   ---   command with 1 input
  operation with 1 input

command:	RUN  list_of_Logo_instructions

operation:	RUN  [ expression ]

If RUN is used as a command, it carries out all instructions in the list of Logo instructions.

? RUN [PR "ONE PRINT "TWO]

ONE

TWO

? MAKE "WHAT [REPEAT 20 [FD 80 LT 117] ]

? RUN :WHAT

? RUN SE [LT 23] :WHAT

RUN list is the same as REPEAT 1 list.

If RUN is used as an operation, it outputs the value of the input expression  (that is, the result of calculating the expression).

? MAKE :A RUN READLIST

: 23 * 9	; this is what you type for READLIST

? SH :A

207


See also related procedures...

ASK

EACH

REPEAT


Primitive Procedure - RUNPROGRAM; RUNPROG
RUNPROGRAM; RUNPROG   ---   operation with 1 or 2 inputs

RUNPROGRAM  word

(RUNPROGRAM  word  number )

Starts other Windows or even non-Windows application. The RUNPROGRAM operation receives one or two inputs: the first input word is the name of the program (in this case, it must contain the extension) and, if the program is not on the DOS path, the complete path must be included. The optional second input is a number between  0 to 4, inclusive, and defines the initial state of the program's window:

0 normal window, the window becomes active,

1 minimised (iconized) window. It becomes active,

2 maximised window. It becomes active,

3 normal window, Logo remains active,

4 minimised window, Logo remains active

The output of the RUNPROGRAM operation is a number. If it is less than 32 then it is an error code. Values above 32 are handles of the program just started (and have no meaning in Logo). The error codes are:

0 System was out of memory, executable file was corrupted, or relocations were invalid.

2 File was not found.

3 Path was not found.

5 Attempt was made to dynamically link to a task, or there was a sharing or network-protection error.

6 Library required separate data segments for each task.

8 There was insufficient memory to start the application.

10 Windows version was incorrect.

11 Executable file was invalid. Either it was not a Windows application or there was an error in the .EXE image.

12 Application was designed for a different operating system.

13 Application was designed for MS-DOS 4.0.

14 Type of executable file was unknown.

15 Attempt was made to load a real-mode application (developed for an earlier version of Windows).

16 Attempt was made to load a second instance of an executable file containing multiple data segments that were not marked read-only.

19 Attempt was made to load a compressed executable file. The file must be decompressed before it can be loaded.

20 Dynamic-link library (DLL) file was invalid. One of the DLLs required to run this application was corrupt.

21 Application requires 32-bit extensions.

Note that some applications change the initial state of their window as you define it with the RUNPROGRAM operation. So it may appear that this option of RUNPROGRAM is not working properly.

MAKE "no RUNPROGRAM "calc.exe	; starts the calculator
MAKE "no RUNPROG "command.com	; starts MS-DOS
MAKE "no (RUNPROG "clock.exe 3) 	; starts clock, but Logo remains active


See also related procedures...

RUN


Primitive Procedure - QUOTIENT: Advanced Features
QUOTIENT   ---   advanced features

QUOTIENT point1 number

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs a point representing a directed line segment with the same direction as point1. However, the magnitude of the original point1 is divided by the input number. That is, QUOTIENT point1 number is the same as
SENTENCE QUOTIENT FIRST point1 number QUOTIENT LAST point1 number.
It's also the same as PRODUCT point1 1/number.

? SH QUOTIENT [130 75] 3
[43.33 25]

QUOTIENT angle point1

Outputs a point representing a directed line segment with the same magnitude as point1. However, the direction of the original point1 is changed by rotating it by number degrees.

? SH QUOTIENT 90 [0 120]	; rotating by 90 to the right
[120 0]

? SH QUOTIENT -45 [0 120]	; rotating by 45 to the left

[-84.85 84.85]


Primitive Procedure - ROUND: Advanced Features
ROUND   ---   advanced features

ROUND point

Points represent Directed Line Segments ...

Points can also be compared ...

IF point = [a b ], ROUND outputs a point [m n ] with both components rounded to the nearest integers.

ROUND point is the same as
SENTENCE ROUND FIRST point ROUND LAST point.

? SH ROUND [233.65 44.12]
[234 44]

? SH ROUND [-233.65 -44.12]

[-234 -44]


Primitive Procedure - READFROM: Advanced Features
READFROM   ---   advanced features

READFROM  "Clipboard

The standard input stream can also be redirected to come directly from the Windows Clipboard.

To copy or cut any text onto the Clipboard you can use another Windows application, or use PRINTTO to redirect the standard Logo output stream there etc.


Primitive Procedure - READKEY: Advanced Features
READKEY   ---   advanced features: command & operation with 1 input

(READKEY 0)

(READKEY 1)

(READKEY 2)

When READKEY receives an input, it handles the incoming codes buffer in a different way. (READKEY 0) is a command which clears the buffer completely. Note that it is not an operation in this case, so it has no output. (READKEY 0) is nearly equivalent to the instruction:

WHILE [KEY?] [IGNORE READKEY]

(READKEY 1) is an operation that removes all but the most recent codes from the buffer. The most recent code is the output of the operation. (READKEY 2) is the same as READKEY with no input.

(READKEY 0) and (READKEY 1) are options that should help to handle situations when the user presses several keys or mouse buttons too fast for our user defined Logo procedures to handle all of them.


Primitive Procedure - READLISTDIALOG: Advanced Features
READLISTDIALOG; RLD   ---   advanced features: 3 or 4 inputs

(READLISTDIALOG  text1  text2  input3 )

(READLISTDIALOG  text1  text2  input3  text4 )

where input3 is either the empty list or a list of 2, 4, 5 or 9 numbers

If the operation has more than 2 inputs, input3 sets the position, size, frame type and colours of the dialogue. It is a list of these forms:

[ ] - sets the default position, size, frame and colours (this form is used when you want to set the 5th input without setting the 4 other inputs),

[x y] - defines the position of the dialogue in absolute screen co-ordinates. The size of the dialogue will be default. If either x or y is -32768, then the corresponding co-ordinate will keep the default value,

[x y width height] - defines the position and size of the dialogue. If the height is 0, then the size of the whole dialogue is set to the size of the edit box plus the border (there will be no place for the question). If either x, y, width or height is -32768 then the corresponding co-ordinate or size will keep the default value,

[x y width height frame.type] - defines the position, size and frame type of the dialogue, where the frame.type is a number 0, 1 or 2:

0 specifies the default (thick) frame,

1 specifies thin black frame, like a window which cannot be sized,

2 specifies no frame at all,

[x y width height frame.type col1 col2 col3 col4] - defines the position, size, frame type and colours. The col1, col2, col3 and col4 are integers between 0 and 15. Col1 is the colour of the box background (default is grey - 7), col2 is the colour of the text of the question (default is taken from Windows but normally is black - 0), col3 is the colour of the edit control's background (default is taken from Windows but normally is white - 15) and col4 is the colour of the text in the edit control (default is taken from Windows but normally is black - 0).

? MAKE "value RLD
? MAKE "USER.NAME (RLD [What is your name?] [Hello])
? IF (RLD [Is this OK? Answer Yes or No.] [ ] [ ] "Yes) = "Yes [PR "OK]
? MAKE "value (RLD [ ] [Enter a value:] [100 100 70 0] 120)

If the operation also has the 4th input - text4, it specifies the initial string which will appear in the edit box.


Primitive Procedure - READLISTTURTLE; RLT: Advanced Features
READLISTTURTLE; RLT   ---   advanced features: 1 or 2 inputs

(READLISTTURTLE  text )

(READLISTTURTLE  text  number )

If the operation has 1 or 2 inputs, the text then specifies the initial string which will appear in the edit box.

The optional number input defines the actual width of the dialogue. The length of the input string is not affected by specifying the width of the dialogue and can be up to 254 characters. If the input does not fit into the edit box, it scrolls horizontally.

The READLISTTURTLE operation uses the font (set by the SETTT command) of the first active turtle.


Primitive Procedure - RANDOM: Advanced Features
RANDOM   ---   advanced features

RANDOM  point

If the point is [X Y] (both X and Y must be bigger or equal to 0), this instruction is the same as SE RANDOM X RANDOM Y.


Primitive Procedure - SAVE
SAVE   ---   command with 1 or N inputs

SAVE LGO_file

(SAVE LGO_file input1 ... )

where input1, ... is either a memory_object or a list_of_memory_objects

Saves all chosen objects into a file with the chosen name. If SAVE has only one input, all user-defined procedures are saved; that is, SAVE file is equivalent to SAVE file PROCS, see PROCS. To save other objects, you have to specify them, for example:

? (SAVE "FILE1 PROCS [:A :B :C])
; will save all procedures and three variables,

? (SAVE "FILE2 [FUN GUN] NAMES)
; will save procedures FUN and GUN

; and all variables,

? (SAVE "FILE3 "FUN ":A PROPS)
; will save FUN procedure, variable :A

; and all words with defined properties

About PROCS, NAMES, and PROPS Lists...

The contents of the resulting file is organised so that, when loaded back by LOAD, the same objects will be recreated:

procedures are saved as their full definitions of the form TO ... END,

variables are saved in the form MAKE name value,

words with properties are saved in the form PPROP word name value.

Buried objects, see BURY, will not be saved unless they are named. To save all buried objects, use SAVE file BURIED, see BURIED.

If you are saving any number of variables with images as their values, two files are created instead of one: the original one and another one with the same name but the .LGW extension. It will contain an image created by joining all images together. For each such variable name, an instruction

MAKE "name LOADIMAGE "* [number1 number2]

is inserted into the original file to recreate the same image value when loaded back. If an image is a part of a complex data structure, it is not saved.

The file will be created and saved in the current work directory (the output of PATH operation), or in the directory set by the complete path within the file name. To understand the rules for setting work directory, see SETPATH and SETLOGO with "AUTOPATH as its input.

If no extension is added, .LGO is added. If a file with the same name already exists, it is deleted.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

APPEND

LOAD

LOADIMAGE

BURY

LOADLIBRARY

SAVELIBRARY

and other Files Management procedures


Primitive Procedure - SAVEBITMAP
SAVEBITMAP   ---   command with 2 inputs

SAVEBITMAP  BMP_file  image

Saves the first frame of the image into the file as a standard bitmap.

Only the first frame of the image is transformed into the bitmap format and saved into the file, which can be later used by Logo, Paintbrush or any other bitmap graphics application. If the frame also contains transparent colour, it is first replaced with white. The maximum size of an image is 255 x 255 pixels, the resulting bitmap will never exceed this size.

The file will be created and saved in the current work directory, or in the directory specified by the complete path within the file name. To understand the rules for finding and setting the work directory, see PATH and SETPATH and SETLOGO with "AUTOPATH as its input.

If no extension is used, .BMP is added. If  a file already exists with the same name, it is deleted.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

SAVEIMAGE

SAVESCREEN

LOADBITMAP

LOADSCREEN


Primitive Procedure - SAVEIMAGE
SAVEIMAGE   ---   command with 2 or N inputs

SAVEIMAGE LGW_file  image

(SAVEIMAGE LGW_file  image1  image2... )

Saves the chosen image into the file. If there are more images following the name of the file, all of them are first joined together by IMAGE to form one image.

So:

(SAVEIMAGE file image1 image2 ... )

is the same as to:

SAVEIMAGE file (IMAGE image1 image2 ... )

(The only difference is that the number of frames which IMAGE can join is limited by 252, while SAVEIMAGE with many inputs can exceed this number.)

If only partial or no path is set within the file name, the IMAGE subdirectory of the home directory is used to place the file in. To change this setting, use SETPATH with the "IMAGE as the first input. To find the current setting, use PATH with the "IMAGE input. If no extension is used, SAVEIMAGE adds .LGW. To load an image from the file, use LOADIMAGE.

The values of the variables CAR1, CAR2, CAR3, and CAR4 contain one frame images:

? (SAVEIMAGE "CARS.LGW :CAR1 :CAR2 :CAR3 :CAR4)

? SETSHAPE LOADIMAGE "CARS [1 3]

If a file already exists with the same name, it is deleted.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

LOADIMAGE

GETIMAGE

PUTIMAGE

IMAGE?


Primitive Procedure - SAVELIBRARY; SAVELIB
SAVELIBRARY; SAVELIB   ---   command with 1 or N inputs

SAVELIBRARY library

(SAVELIBRARY library input1 ... )

where input1, ... is either a memory_object or a list_of_memory_objects

If the command has only one input, a library is created containing:

all turtles that currently exist together with their settings,

all memory objects that are currently not buried. Buried objects will only be saved into the library if they are made temporarily visible with SETBURY "FALSE.

The other option is to name memory objects that should be saved into the library. However, it is not possible to choose which turtles to save - all of them will be saved together with their settings. Buried objects will not be saved unless they are named. To save all buried objects, use SAVELIB library BURIED, see BURIED.

The file will be created and saved in the current work directory (the output of the PATH operation), or in the directory set by the complete path within the library name. To find out about the rules for setting work directory, see SETPATH and SETLOGO with "AUTOPATH as its input.

If no extension is used, .LGP is added. However, any valid file extension is acceptable - although the resulting file will always be in the LGP internal structure. If a file already exists with the same name, it is deleted. For example:

? SAVELIBRARY "LIB1 PROCS NAMES

will save all user-defined procedures and variables together with all turtles into a library LIB1.LGP. Buried procedures and variables will not be saved unless SETBURY is set to FALSE, see also PROCS and NAMES.

  Colour Transformations in Loading and Saving Graphics


See also related procedures...

LOADLIBRARY

APPEND

LOAD

LOADIMAGE

BURY

SAVE

and other Files Management procedures


Primitive Procedure - SAVESCREEN
SAVESCREEN   ---   command with 1 or 2 inputs

SAVESCREEN  BMP_file

(SAVESCREEN  BMP_file  point )

(SAVESCREEN  BMP_file  rectangle )

Saves the actual contents of the graphics screen into the file. The file will contain a standard bitmap of the size of the graphics screen - if second input is not given. Turtles' shapes are not included because they are not a part of the graphics screen contents. (To include any turtle's shape in the contents of the screen, use STAMP.)

If the second input is given, only a part of the screen is saved:

if it is a point, the rectangle specified by this point as its upper left corner and lower right corner of the graphics screen as its lower right corner is saved,

if it is rectangle, its contents is saved.

To load new contents into the graphics screen, use LOADSCREEN. If only partial or no path is found within the given file name, the SCREEN subdirectory of the home directory is used to store the file. If that subdirectory does not exit, the IMAGE subdirectory is used instead. To change this setting, use SETPATH with the "SCREEN as the first input. To find the current setting, use PATH with the "SCREEN input.

If no extension is given, SAVESCREEN adds .BMP. If a file already exists with the same name, it is deleted.

  Colour Transformations in Loading and Saving Graphics

Alternative:

Save Screen As... in the File Menu of the Main Window


See also related procedures...

LOADSCREEN

LOADBITMAP

SAVEBITMAP


Primitive Procedure - SENTENCE; SE
SENTENCE; SE   ---   operation with 2 or N inputs

SENTENCE any1 any2

(SENTENCE any1 ... )

Outputs a list made up in the following way: if all inputs are lists, their members are combined into a single list.

? SH SE [A B C] [D [E] F]	; SE is SENTENCE

[A B C D [E] F]

If any input is a word, it is inserted into the resulting list as a member:

? PR SE "Peter [is not here.]

Peter is not here.

? SH SE "PETER "PAUL

[PETER PAUL]

? PR SE "PETER "PAUL

PETER PAUL

If any input is an image with N frames, an expression of the form {imageN} is included in the resulting list:

? SH LIST [Basic turtle shape is] GETSHAPE

[Basic turtle shape is {image24} ]

Note the difference between SENTENCE and LIST. Also note the difference between SHOW and PRINT when applied to a list.

? SH LIST [A B C] "D

[ [A B C] D]

? SH SE [A B C] "D

[A B C D]


See also related procedures...

LIST

WORD


Primitive Procedure - SETBACKGROUND; SETBG
SETBACKGROUND; SETBG   ---   command with 1 input

SETBACKGROUND colour

Sets the background colour of the graphics screen as chosen in the input.

The whole graphics screen is cleaned and filled with the colour - the contents of the screen is lost. However the state of the turtles is not changed - they all stay at their positions, they are shown or hidden as before, etc.

Compare CLEAN, DRAW and CLEARSCREEN carefully.

To find the current background colour, use BACKGROUND.


See also related procedures...

BACKGROUND

SETGS

PENCOLOUR

SETPENCOLOUR

SETTC

CLEAN

CLEARSCREEN


Primitive Procedure - SETBURY
SETBURY   ---   command with 1 input

SETBURY logical

How and Why You Bury Memory Objects...

Creating and Using a Library...

If there are currently any buried objects, SETBURY "FALSE makes them all temporarily visible; i.e. they will be listed in PROCS, NAMES, and PROPS lists, they will be listed in the Memory Window, they can be printed by PO or POTS, they can be edited with EDIT etc. However, these objects are still dealt with by Logo as buried and are items of the BURIED list.

How Logo Displays and Processes Buried Objects

SETBURY "TRUE will make these buried and temporarily visible objects become invisible once more.

Alternative:

Show Also Buried in the Objects Menu of the Memory Window


See also related procedures...

BURY

BURYALL

BURIED

UNBURY


Primitive Procedure - SETBUTTONS
SETBUTTONS   ---   command with 1 or 2 inputs

SETBUTTONS [definition  ...  ]

(SETBUTTONS  number  definition )

SETBUTTONS [ ]

where

definition is a button definition and number is an integer between 1 and 30.

This sets the texts/graphics and actions that will be associated with the buttons in the Buttons Window. The first definition will appear on the first button, second definition on the second button etc. If you give a number and a definition, you define one particular button. If the input is an empty list [ ], all buttons are restored to the default size and location within the window and all texts/ graphics and actions are removed.

To find current texts which are defined for buttons, use BUTTONS. The SETBUTTONS command can be used both when the Buttons Window is shown or hidden.

To show the Buttons Window, use SHOWBUTTONS. To hide it, use HIDEBUTTONS.

? SETBUTTONS [ ]

? SETBUTTONS [ [cs] [ [go] [FD 100 RT 90] ] [setpc] ]

? SH BUTTONS

[ [cs] [ [go] [FD 100 RT 90] ] [setpc] ]

? SH (BUTTONS 2)

[ [go] [FD 100 RT 90] ]

? SETBUTTONS LPUT [setpw] BUTTONS

? SH BUTTONS

[ [cs] [ [go] [FD 100 RT 90] ] [setpc] [setpw] ]

Alternatives:

each button can be defined or redefined if you click the right mouse button on it,

each button can be moved within the Buttons Window, if you press the Shift key and drag it with the right mouse button.


See also related procedures...

BUTTONS

HIDEBUTTONS

SHOWBUTTONS

BUTTONSSIZE

SETBUTTONSSIZE


Primitive Procedure - SETBUTTONSSIZE
SETBUTTONSSIZE   ---   command with 1 input

SETBUTTONSSIZE [X Y w h ]

SETBUTTONSSIZE [X Y w h text ]

SETBUTTONSSIZE [X Y w h [ ]]

SETBUTTONSSIZE [ ]

where X, Y, w and h are numbers

Sets the size and position of the Buttons Window.

If the input list contains four numbers [ X Y w h ], it sets the upper left corner of the window with the point [X Y], together with its width w and height h. Note that X, Y are absolute screen co-ordinates, and w and h are the width and height of the window's client area (i.e. of the window without the surrounding black frame and without its caption).

If the list also contains  text, it will become the title of the Buttons Window. If the fifth member is the empty list [ ], the window's title bar will be hidden - so that the window cannot be moved by the mouse.

SETBUTTONSSIZE with only an empty list [ ] as its input resets the default position and size. If used together with the SETBUTTONS [ ] instruction, it will clean all buttons and reset the default (undefined) action of the Buttons Window, see SETBUTTONS.

? SETBUTTONSSIZE [0 0 100 110]
? SETBUTTONSSIZE SE [535 80] BF BF BUTTONSSIZE
; changes only the position, not the size and the title
? SETBUTTONSSIZE [485 80 150 110 [Your Commands] ]


See also related procedures...

BUTTONSSIZE

SETBUTTONS

BUTTONS

HIDEBUTTONS

SHOWBUTTONS


Primitive Procedure - SETCURSOR
SETCURSOR   ---   command with 1 input

SETCURSOR  [number1  number2 ]

where

number1 is an integer between 1 and 80, inclusive, and

number2 is an integer between 1 and 26, inclusive

Prints the text prompt at the location set by [number1 number2 ], where number1 indicates the column in the text screen and number2 indicates the row of the new location, and places the text cursor next to it.

? CT TS

? REPEAT 200 [SETCURSOR SE 1 + RANDOM 80 1 + RANDOM 26 TYPE "WOW!]

When SETCURSOR is typed directly in the command line (and no other command follows at the same line), Logo moves its cursor to the specified location and prints the text prompt there(normally ? followed by a space) to indicate it is ready to carry out more Logo instructions.

Location [1 1] is the upper left corner of the text screen when Logo is in the TEXTSCREEN mode. To find the current position of the cursor, use CURSOR. To change the current text prompt, use SETPROMPT.


See also related procedures...

CURSOR

SETTC

SETPROMPT


Primitive Procedure - SETFILLCOLOUR; SETFC
SETFILLCOLOUR; SETFC   ---   command with 1 input

SETFILLCOLOUR colour

For each active turtle this sets its fill colour to be used by FILL and POLYGON.

If you haven't set any fill colour for a turtle, it will use the turtle's pen colour. Thus this command makes it possible to use different colours for the outline and the fill itself. However, every time you set the pen colour with SETPENCOLOUR, the fill colour is set to the same colour.

To find the fill colour of the first active turtle, use FILLCOLOUR.

? MAKETURTLE 22 [ 100 100 180 ]

? TELL 22

? (SH PC FC)

0 0

? SETFC 7

? SH FC

7

? SETPC 11

? (SH PC FC)

11 11

To specify the fill pattern, use SETFILLPATTERN.


See also related procedures...

FILLCOLOUR

FILL

SETFILLPATTERN

FILLPATTERN

SETPENCOLOUR

PENCOLOUR

POLYGON


Primitive Procedure - SETFILLMODE
SETFILLMODE   ---   command with 1 input

SETFILLMODE input

where input is either 0 or 1

For each active turtle this sets one of two possible rules for filling:

SETFILLMODE 0  means to fill a region (surrounding an active turtle) bordered by any colour or colours different from the region's colour. (The surrounding area can be defined as a continuous area around a turtle where all points have the same colour as the point at the current turtle's position, that is the output of DOTCOLOUR.) Be careful, the area must have no "cracks" in its border or the colour will leak through and fill a larger area or even the whole screen. This method is the default for any turtle in SuperLogo,

SETFILLMODE 1 means to fill an area (surrounding an active turtle) which is bordered by an active turtle's pen colour. In this method the area may contain any number of other colours - the whole region is filled. If there isn't a border on the graphics screen at this moment, the whole screen is filled.

Any turtle can use either method 0 or 1. If you don't use SETFILLMODE, all turtles use method 0, which is similar to, for example, the Paintbrush application. The selected fill mode does not affect POLYGON.


See also related procedures...

FILLCOLOUR

FILL

SETFILLPATTERN

FILLPATTERN

SETPENCOLOUR

PENCOLOUR

POLYGON


Primitive Procedure - SETFILLPATTERN; SETFP
SETFILLPATTERN; SETFP   ---   command with 1 input

SETFILLPATTERN  fill_pattern

For each active turtle SETFILLPATTERN defines its filling pattern to be used by FILL and POLYGON for filling. If you haven't used the command, the filling pattern is 0.

? MAKETURTLE "STEFAN [ 100 100 90 ]

? TELL "STEFAN

? SH FP

0

? SETFP 4

? SH FP

4

To find the filling pattern of the first active turtle, use FILLPATTERN.


See also related procedures...

FILL

POLYGON

FILLPATTERN

SETFILLCOLOUR

FILLCOLOUR


Primitive Procedure - SETFORMAT
SETFORMAT   ---   command with 1 input

set floating format

SETFORMAT number

where number is an integer between 0 and 18, inclusive

Sets the number of decimal places displayed when numbers are printed or shown. This setting doesn't influence the precision of calculations, which is always the same. When Logo is started, SETFORMAT is defined as 2.

? SH EXP 1

2.72

? SETFORMAT 10

? SH EXP 1

2.7182818285

The Number of Decimal Places Displayed...


See also related procedures...

PRINT

SHOW

and other Numeric Operations


Primitive Procedure - SETGS
SETGS   ---   command with 1 input

set graphics screen

SETGS  [num1  num2 ]

where

num1, num2 are integers between 8 and 2048, inclusive.

It defines the current settings of the graphics screen. Numbers num1 and num2 represent its width and height (in points).

By changing the size of the graphics screen, the number of lines of the text screen will not be affected. To find the current settings of the graphics screen, use GETGS.

Alternatives:

open the Set Screens dialogue box by selecting Options menu Set Screen... in the Main Window. In the dialogue box you can see and change all settings for both screens,

the same dialogue can be opened if you click the right mouse button anywhere in the graphics screen and choose Set Screens... in the pop-up menu.


See also related procedures...

GETGS

GETTS

SETTS


Primitive Procedure - SAVE: Advanced Features
SAVE   ---   advanced features

SAVE LGO_file input2 input3 ...

where input1, ... is either a memory_object or a list_of_memory_objects

SAVE command belongs to the group of special Logo primitive procedures that can be used without brackets even if they are used with other than their basic number of inputs. In this case all expressions up to the end of the current line are acted upon and considered to be inputs to this procedure.

This group consists of the procedures APPEND, SAVE, SAVELIBRARY and PRINTMEMORY.

If any of the inputs input2, input3, ... is in the following form:

[memory_object ... [ any text ] ... memory_object ... ]

then any text is saved into the named file as a separate Logo instruction. For examples:

? SAVE "File1 [Fun STARTUP] [:Var1 :Var2 [STARTUP] ]

will create a file of the following structure:

TO Fun1

...
END
TO STARTUP
...
END

MAKE "Var1 ...

MAKE "Var2 ...

STARTUP

Another example:

? SAVE "File1 [Fun1 [; finds the maximum] Fun2 [; finds the minimum] ]

SAVE "Clipboard

SAVE "Clipboard input2 ...

(SAVE "Clipboard input2 input3 ... )

where input1, ... is either a memory_object or a list_of_memory_objects

Specified objects are saved into the Windows Clipboard. From there they can be used either by other Logo procedures, like LOAD or LOADIMAGE, or other Logo tools, like the File Editor, or other Windows applications.


Primitive Procedure - SAVEBITMAP: Advanced Features
SAVEBITMAP   ---   advanced features

SAVEBITMAP "Clipboard  image

Instead of saving the first frame of an image into a file, it can also be saved onto the Windows Clipboard. From there you can paste it into Paintbrush or other Windows bitmap graphics editors, or you can load it back into Logo for example with LOADSCREEN or LOADBITMAP.


Primitive Procedure - SAVEIMAGE: Advanced Features
SAVEIMAGE   ---   advanced features

SAVEIMAGE "Clipboard  image

SAVEIMAGE "Clipboard  image1  image2 ...

(SAVEIMAGE "Clipboard  image1 ... )

Instead of saving the image into a file, it can also be saved into the Windows Clipboard. From there you can load it back into Logo with LOADIMAGE.


Primitive Procedure - SAVELIBRARY; SAVELIB: Advanced Features
SAVELIBRARY; SAVELIB   ---   advanced features

SAVELIBRARY  library  input1  input2 ...

SAVELIBRARY command belongs to the group of special Logo primitive procedures that can be used without brackets even if they are used with other than the basic number of inputs. In this case all expressions up to the end of the current line are acted upon and considered to be inputs to this procedure.

This group consists of the procedures APPEND, SAVE, SAVELIBRARY and PRINTMEMORY.

SAVELIBRARY  "Clipboard

SAVELIBRARY  "Clipboard  input1  input2 ...

(SAVELIBRARY  "Clipboard  input1 ... )

where input1, ... is either a memory_object or a list_of_memory_objects

The selected contents of a library can also be saved into the Windows Clipboard. From there the complete library can be reloaded either with LOADLIBRARY, or its memory objects can be reloaded with the Paste command in the Edit menu of the Memory Window.


Primitive Procedure - SAVESCREEN: Advanced Features
SAVESCREEN   ---   advanced features

SAVESCREEN  screen_of_project

(SAVESCREEN  screen_of_project  point )

(SAVESCREEN  screen_of_project  rectangle )

This command can also be used to save the complete or partial contents of the graphics screen into a project as its additional screen (not the basic one). Using

? SAVESCREEN "#Project.LGP	; or

? (SAVESCREEN "#Project.LGP [50 80]	; or

? (SAVESCREEN "#Project.LGP [50 100 200 120]

you save the complete or partial region (a rectangle) of the graphics screen as the latest screen of Project.LGP. This is true even if the project doesn't contain its basic screen. That is, if Project.LGP contains no screens, SAVESCREEN "#Project.LGP will create an additional screen number #1.

SAVESCREEN  "Clipboard

(SAVESCREEN  "Clipboard  point )

(SAVESCREEN  "Clipboard  rectangle )

Instead of saving the contents of the graphics screen (complete or only a region) into a file, it can also be saved into the Windows Clipboard as a standard bitmap. From there you can paste it into Paintbrush or other Windows bitmap graphics editor, or you can load it back into Logo with LOADSCREEN or LOADBITMAP.


Primitive Procedure - SETBACKGROUND; SETBG: Advanced Features
SETBACKGROUND; SETBG   ---   advanced features

(SETBG  colour  X)

where X is either 0 or 1

SETBG can be used with 2 inputs as well: If X is 1, the effect is the same as for the instruction SETBG colour. If X is 0, however, the command only sets the actual background colour but does not clear the screen immediately (i.e. this setting will affect the graphics screen later, when you use CLEARSCREEN, GETIMAGE, PENERASE, CLEAN and other Logo primitive commands which make use of the setting of the background colour).


Primitive Procedure - SETGS: Advanced Features
SETGS   ---   advanced features

SETGS  [num1  num2  num3  num4 ]

where

num3, num4 are either 0 or 1

This alternative allows you to set some more characteristics of the graphics screen. If number num3 is 1, the graphics screen will be centered in the Main Window; if it is 0, its upper left corner will be located in the upper left corner of the working area of the Main Window. If number num4 is 1, the scroll bars will be displayed at the right and bottom edges of the graphics screen, otherwise they will not be displayed.


Primitive Procedure - SETHEADING; SETH
SETHEADING; SETH   ---   command with 1 input

SETHEADING angle

Turns each active turtle to the new heading in angle (that is, independently of its actual heading).

The heading is measured in degrees clockwise from the North, that is, SETHEADING 0 sets the active turtles to the North, SETHEADING 90 sets them to East, etc.

To find the heading of the first active turtle, use HEADING.

? MAKETURTLE 1 [ ]	; [ ] here is the same as [ 0 0 0 ]

? MAKETURTLE 2 [ ]

? ASK 2 [SETHEADING 180]

? TELL [1 2]

? FD 100 RT 45 FD 100


See also related procedures...

HEADING

LEFT

RIGHT

TOWARDS


Primitive Procedure - SETHOTSPOT
SETHOTSPOT   ---   operation with 2 inputs

SETHOTSPOT  image  hot_spot

SETHOTSPOT  image  [input1 input2 ... ]

where input1, ... is either a hot_spot or a number.

Outputs an image with the same number of frames and the same contents as the input image has. However, some or all hot spots of these frames are redefined by the second input.

If the second input is a hot spot, only the hot spot of the first frame of the image will be modified - other frames are included in the result with no changes. If the second input is a list of several hot spots, the first of them will become the hot spot of the first frame of the image, second will become the hot spot of the second frame, etc. (However, you do not have to set all N hot spots in the image.)

If there is a number in the second input, for example [hot-spot1 ... M hot_spot2 ...], hot_spot2 will become new hot spot of the M-th frame. If hot_spot2 is followed by another hot spot, it will modify the M +1-th frame etc.

For example:

[1 5] would specify a new hot spot for the first frame only,

[ [1 2] [3 4] ] changes the hot spots of only the first and second frames,

[ [1 4] 4 [3 5] [4 6] ] changes the first frame, and the 4th and 5th frames.

? MAKE "X ITEM [1 5] GETSHAPE 	; take first 5 frames of the default shape

? SH HOTSPOT :X

[ [7 17] [6 16] [6 15] [4 12] [3 9] ]

? MAKE "X SETHOTSPOT :X [ [10 20] [9 19] [12 30] [8 24] ]

; 5th frame is not changes

? SH :X = SETHOTSPOT :X [4 4]

FALSE

? SH :X = SETHOTSPOT :X [ ]

TRUE


See also related procedures...

HOTSPOT

PUTIMAGE

IMAGESIZE

SETSHAPE


Primitive Procedure - SETIMODE
SETIMODE   ---   command with 1 input

SETIMODE input

where input is either 0, 1 or 2

Specifies the mode for defining transparency, when creating images.

The default setting is SETIMODE 0. If you create an image with GETIMAGE in this mode, all its parts identical in colour to the background colour will be transparent when printed on the screen with PUTIMAGE, STAMP or SETSHAPE. When exported by SAVEBITMAP into a .BMP file, all transparent parts will be black.

In SETIMODE 1 mode no parts of an image created with GETIMAGE are transparent.

When SETIMODE 2 is chosen, only the outer parts of the image identical to the background colour will be transparent. The Inner parts, that is, the parts completely surrounded by other colours, will not be transparent.


See also related procedures...

GETIMAGE

PUTIMAGE

SETSHAPE

LOADIMAGE

SAVEBITMAP


Primitive Procedure - SETLOGO
SETLOGO   ---   command with 1 input

SETLOGO [key_word  input1  key_word  input2 ... ]

where

each input1, input2, ... is either a word or a list,

key_word is one of the following ERROR, VERSION, HELP, AUTOPATH, STEPPING, DECIMAL, PRINT, SAVE, BEEP or SOUND

It customises the Logo environment by setting some of the user's preferences. Primarily is used in the SLOGO.INI initial file, which is an ordinary text file containing Logo language instructions. These are always checked when Logo is started or when ERALL used.

ERROR  is either 0 or 1, where 0 makes Logo print all error messages directly into the text screen - these messages are always one sentence explanations of the reason why an error has occurred. If the value of ERROR is 1, error messages will be displayed in a separate pop-up window and in many cases will have two sentences trying to describe the situation more accurately. 0 is the default.

VERSION is either 0 or 1, where 0 sets Logo to accept only the original English names of all its basic procedures and special words. If the value is 1, Logo understands (beside English names) also national equivalents of these names. For example FORWARD can then be replaced by the Dutch word VOORUIT or its abbreviation VT. This is the as turning the Options Menu Dutch Version on or off (if that version is available).

HELP    is either 0 or 1. If it is 0, the Windows Help application will open SLOGO.HLP file to display help topics. If the value is 1, Help will open SLOGO0.HLP file, which is an alternative "Help for Children" file.

AUTOPATH - is either 0 or 1. The default is 0 which means that loading a project or loading an image doesn't change the actual path. If it is 1, each Open Project command will update the work directory (the output of PATH with "PROJECT as its input) and each LOADIMAGE operation will update the image path, that is, the path implicitly used by LOADIMAGE. To change this setting manually, use SETPATH with "IMAGE as its first input or the Set Path... in the Main Window. To find the current setting, use PATH with the "IMAGE input. Updating the path means that the next Open Project command or LOADIMAGE operation will use the same path as specified in the latest case.

STEPPING is either 0 or 1. If it is 0, the stepping mode is turned off. If it is 1, the stepping mode is turned on. This is the same as turning the Options Menu Stepping command on or off.

DECIMAL is either a one letter word or an empty list [ ]. It sets the word as the decimal part separator for numbers. If it is an empty list [ ], it resets the decimal separator to the default character defined by Windows. The decimal separator is by default a point (.). When SuperLogo is started, it reads the value of the decimal separator which is set in the Windows Control Panel - International option. With SETLOGO it can be set to any character which is not a digit and has no special meaning in SuperLogo (that is, it is different from + - * / ( ) = < > ; [ ] ~ " and the space). Note that:

this option must be used carefully because it makes it possible to create projects that will not run on another computer,

this setting affects the way how Logo recognises the numbers and how it prints them.

? SETLOGO [DECIMAL ,]
? PR 1.3
1.3	; not affected because 1.3 was entered in the program
? PR 1,3	; 1,3 is recognised as a number
1,3
? PR 1.2 + 1,3	; decimal point can always be used
2,5	; this is the result of adding two numbers
? SETLOGO [DECIMAL .]
? PR 1,3
MESSAGE: I don't know how to 1,3

; now 1,3 is not recognised

; as a number,

; SuperLogo thinks this is a name of a command

PRINT   is either 0 or 1. This enables and disables all Logo printing commands. If it is 0, Logo cannot print. If it is 1 and there is at least one printer defined in Windows, Logo can print. 1 is the default. However, if there is no printer defined in Windows, the default is 0.

SAVE    is either 0 or 1. 1 is the default. If set to 0, all Logo saving operations are disabled. This option can be used to prevent the user from writing to the disk. If this is the case, any attempt to save something with a Logo command will result in an error message saying that saving is not allowed in the Demo version.

BEEP    is either 0 or 1. 1 is the default. If set to 0, Logo does not produce any warning beeps. Can be useful in computer labs, for example.

SOUND  is either 0 or 1. 1 is the default. If set to 0, SOUND, PLAY and PLAYWAVE will have no effect i.e. the program will run with no sounds.

Alternatives:

choose Options Menu Errors to Pop-Up Window,

choose Options Menu Help for Kids ,

choose Options Menu Dutch Version,

choose Options Menu Auto SetPath,

choose File Menu Set Path...,

choose Options Menu Stepping


See also related procedures...

LOGO


Primitive Procedure - SETLOGOSIZE
SETLOGOSIZE   ---   command with 1 input

SETLOGOSIZE [X  Y  w  h ]

SETLOGOSIZE [X  Y  w  h  number ]

SETLOGOSIZE [X  Y  w  h  number  text ]

SETLOGOSIZE [ ]

where X, Y, w and h are numbers

Defines the position, size, type and title of the Logo Main Window.

The first two members X and Y of the input list specify the absolute co-ordinates of the Main Window's upper left corner. Numbers w and h specify its width and height. The fifth member, if it is included, defines the new state of the window and has the following meaning:

0 normal window, the window becomes active,

1 minimised (iconized) window. It becomes active,

2 maximised window. It becomes active,

3 normal window, Logo remains active,

4 minimised window, Logo remains active.

If the fifth parameter is omitted, it is assumed to be 0. The X, Y, w and h values have special meaning for particular values of the fifth element. If it is:

0 or 3 - the X, Y, w and h define the actual position and size of the window and it is immediately resized,

1 or 4 - the X and Y define the position of the icon on the screen and the w and h are ignored (but they cannot be omitted),

2        - the window is maximised to cover the whole screen, the X, Y, w and h values will be used after restoring the window to the normal size (with the Control Menu Restore command or with the Restore button in the title bar).

5        - the X, Y, w and h have no meaning and the window will re size to be full screen.

The optional sixth input is a new title of the window.

If the input is the empty list [ ], the Main Window is maximised without changing its title and sizes.


See also related procedures...

LOGOSIZE

SETGS

GETGS


Primitive Procedure - SETMOUSECURSOR; SETMC
SETMOUSECURSOR; SETMC   ---   command with 1 input

SETMOUSECURSOR image

SETMOUSECURSOR LGW_file

SETMOUSECURSOR number

SETMOUSECURSOR [ ]

where number is an integer between 0 and 15, inclusive

Replaces the current shape of the mouse cursor with an image set either directly from the input image or with the name of a LGW file, in which this image is stored. That is:

? SETMC "ARROW2

is the same as

? SETMC LOADIMAGE "ARROW2

If the input is a number between 0 and 15, inclusive, a standard Windows cursor is chosen according to the following table:

The mouse cursor is always black and white. If the specified image contains more colours, these would be reduced to black. The maximum size of the mouse cursor is 32 x 32 pixels. Larger images will be reduced to this size (which may change the way it looks). The second frame (if it exists)  is used to show the state of the mouse, when its left button is pressed. To return to the ordinary shape of the mouse cursor, use:

? SETMOUSECURSOR  [ ]


See also related procedures...

CURSOR

SETCURSOR

SETPROMPT

SETTC


Primitive Procedure - SETPATH
SETPATH   ---   command with 1 or 2 inputs

SETPATH  path

(SETPATH  Logo_subdirectory  path )

When used with one input, the path of the SETPATH command sets new a work directory. SETPATH path is the same as (SETPATH "PROJECT path). The work directory is also reset any time you use Open Project... in the Main Window or if you set AUTOPATH to 1 in SETLOGO. In this case the work directory is the directory from where the most recent project was loaded.

When used with "DEMO as its first input, the command sets the DEMO directory. When used with "IMAGE, it sets the IMAGE directory. When used with "WAVE, it sets the WAVE directory. When used with "PROBLEM, it sets the PROBLEM directory. When used with "SCREEN, it sets the SCREEN directory.

If the path does not exist, an error occurs.

Alternative:

Set Path... in the File Menu of the Main Window


See also related procedures...

PATH

LOAD

SAVE


Primitive Procedure - SETPATTERN
SETPATTERN   ---   command with 1 input

SETPATTERN pen_pattern

Sets the pen pattern with which all active turtles will draw while in the PENDOWN state.

To find the current pen pattern of the first active turtle, use PATTERN. If no pattern is defined when creating a new turtle with MAKETURTLE, it is set to the solid line.

? SETPATTERN 3	; there is only one turtle, 0

? SH PATTERN

3


See also related procedures...

PATTERN

SETPEN

SETPENCOLOUR

SETPENWIDTH


Primitive Procedure - SETPEN
SETPEN   ---   command with 1 input

SETPEN word

where word is either PU, PD, PE or PX

This changes the mode of each active turtle's pen to be PENUP, PENDOWN, PENERASE or PENREVERSE. For example, SETPEN "PD  is the same as PENDOWN or simply, PD.

To find the state of the first turtle's pen, use PEN.

? MAKETURTLE "MARY [-20 20 90]

? ASK "MARY [SH PEN]

PD	; new turtle always has PD

? TELL "MARY

? SETPEN "PE	; is the same as PE by itself

To set all options on the turtle's pen in one step, use SETPENSTATE. To find all information about the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PEN

PENDOWN

PENUP

PENERASE

PENREVERSE

PENSTATE

SETPENSTATE


Primitive Procedure - SETPENCOLOUR; SETPC
SETPENCOLOUR; SETPC   ---   command with 1 input

SETPENCOLOUR colour

Defines the pen colour for all active turtles as set by the input.

To find the current pen colour of the first active turtle, use PENCOLOUR. Any turtle draws a line (in the currently set colour, pattern, and width) only if it is active and if its pen is in PENDOWN mode (or PENREVERSE mode, in which some special effects take place).

Note, that if the turtle's pen colour is a RGB colour, the lines drawn by this turtle show as the RGB coloured lines in the graphics screen only if the pen's width is bigger than 1.

To set all options on the turtle's pen in one step, use SETPENSTATE. To see more information about the first active turtle's pen in one step, use PENSTATE.


See also related procedures...

PATTERN

PENCOLOUR

SETPATTERN

SETPEN

SETPENWIDTH

PENSTATE

SETPENSTATE


Primitive Procedure - SETPENSTATE
SETPENSTATE   ---   command with 1 input

SETPENSTATE [word  colour  pen_width  pen_pattern ]

where word is one of PD, PU, PE or PX

Sets all settings of any active turtle's pen. The input is a list of four objects:

whether the pen will be PENDOWN, PENUP, PENERASE or PENREVERSE,

pen colour,

pen width,

pen pattern.

SETPENSTATE is a way to do SETPEN, SETPENCOLOUR, SETPENWIDTH, and SETPATTERN in one. To see all four settings in one, use PENSTATE.

? SETPENSTATE [PU 5 3 2]

? PR PEN

PU

? PR PC

5

? PR PW

3

? PR PATTERN

2


See also related procedures...

PATTERN

PEN

PENCOLOUR

PENSTATE

PENWIDTH

SETPEN

SETPATTERN

SETPENCOLOUR

SETPENWIDTH


Primitive Procedure - SETPENWIDTH; SETPW
SETPENWIDTH; SETPW   ---   command with 1 input

SETPENWIDTH  pen_width

Defines the pen width for all active turtles as set by the input.

To find the pen width of the first active turtle, use PENWIDTH. Any turtle draws a line (in the currently set colour, pattern, and width) only if it is active and in the PENDOWN state (or PENREVERSE state, in which some special effects take place). When a new turtle is created with MAKETURTLE, its pen width is 1.

? SH PW

1

? REPEAT 5 [FD 30 SETPW PW * 3]


See also related procedures...

PATTERN

PENWIDTH

PENCOLOUR

SETPATTERN

SETPENCOLOUR


Primitive Procedure - SETFRAME
SETFRAME   ---   command with 1 input

SETFRAME number

where number is an integer between -32767 and 32767, inclusive

Sets the frame of an active turtle's shape will be used from now on to display the turtle. This only works for the active turtles whose SETFRAMEMODE is TRUE.

If the current shape of a turtle has N frames, SETFRAME 1 means show the turtle with the first frame, SETFRAME 2 with the second frame, etc. The input number is first reduced by modulo N, that is, SETFRAME N+1 is the same as SETFRAME 1, SETFRAME 0 is the same as SETFRAME N, etc..

? SETFRAME 4

? SETFRAME FRAME+1


See also related procedures...

FRAME

SETFRAMEMODE

SETSHAPE


Primitive Procedure - SETFRAMEMODE
SETFRAMEMODE   ---   command with 1 input

SETFRAMEMODE logical

Sets the method by which frames of an active turtle's shape will be used to display the turtle. The basic setting is always SETFRAMEMODE FALSE, which means that frames of an image (which is currently used as the turtle's shape) are used to show the turtle's current heading.

How Different FRAMES of an IMAGE are Used

SETFRAMEMODE TRUE is mainly used for screen animation. In this mode the frames have nothing to do with the turtle's current heading - you control them with the SETFRAME command, saying which frame will be used and when for a turtle on the graphics screen.

SETFRAMEMODE (as a word with no input) can also be used within the second input of the MAKETURTLE command, as in:

MAKETURTLE "JOE [0 0 180 PU SETFRAMEMODE ST]

Here it means that the new turtle JOE will be an animation turtle, that is, a turtle in the SETFRAMEMODE TRUE. Compare this procedure with SETBOXMODE.


See also related procedures...

FRAME

SETFRAME

SETSHAPE

MAKETURTLE

SETBOXMODE


Primitive Procedure - SETPLIST
SETPLIST   ---   command with 2 inputs

set property list

SETPLIST  word  list_of_properties

This defines several properties for the given word. The properties are set by the list of properties in one step. This can be replaced with a sequence of PPROP commands.

? SETPLIST "FATHER [FRENCH PERE GERMAN VATER]

? SH PLIST "FATHER	; find the complete property list

 [FRENCH PERE GERMAN VATER]

? SETPLIST "MOTHER [FRENCH MERE GERMAN MUTTER]

? SH PROPS

["FATHER "MOTHER]

About PROCS, NAMES, and PROPS Lists...

Alternative:

in the List of Objects of the Memory Window all names of words with defined properties are listed. You can define new properties here, you can modify or erase them as well. These words are shown by [image] or [image] icons.


See also related procedures...

PLIST

PROPS

PPS


Primitive Procedure - SETPOS
SETPOS   ---   command with 1 input

SETPOS point

Moves each active turtle to the specified point. SETPOS doesn't change the actual turtle's heading. If the turtle's pen is PENDOWN, it draws a line while moving.

To find the current position of the first active turtle, use POS. Beside SETX, SETXY, SETY, and SETPOS commands, the position of an active turtle is also changed with FORWARD, BACK, CLEARSCREEN, DRAW, and HOME.

If L is a point, SETPOS :L  is the same as  SETXY FIRST :L LAST :L.

? MAKETURTLE "JANE [20 0 0]

? MAKETURTLE "BETTY [40 0 0]

? TELL ALL

? EACH [SH POS]

[0 0]

[20 0]

[40 0]

? SETPOS [-220 150]

? FD 50	; try it


See also related procedures...

POS

SETX

SETXY

SETY

XCOR

YCOR


Primitive Procedure - SETPROMPT
SETPROMPT   ---   command with 1 input

SETPROMPT word

where word has not more than 16 characters

Specifies the text that will be used as a text prompt in the text screen. The basic setting for the text prompt is ? followed by a space (that is, the default text prompt has two characters). Therefore:

? SETPROMPT "Your\ input:\

Your input: PR "HELLO

HELLO

Your input: PR 5

5

Your input: SETPROMPT "?\

?

Where to Use an Escape Character \

Alternative:

the text prompt can also be set in the dialogue box Set Screens which appears on the screen by selecting Options Menu Set Screen... in the Main Window


See also related procedures...

TEXTSCREEN

CURSOR

SETCURSOR

SETTC

SETREADLISTPROMPT


Primitive Procedure - SETREADLISTPROMPT; SETRLPROMPT
SETREADLISTPROMPT; SETRLPROMPT   ---   command with 1 input

SETREADLISTPROMPT  readlist_prompt

Specifies the text that will be used as a new readlist prompt in the text screen. The basic setting for the readlist prompt is a colon (:) followed by a space (that is, the default readlist prompt has two characters).

? SETRLPROMPT "Your\ input:\

? SH RL

Your input: A B C	; you typed A B C

[A B C]


See also related procedures...

READLIST

SETPROMPT


Primitive Procedure - SETSHAPE
SETSHAPE   ---   command with 1 input

SETSHAPE  image

SETSHAPE  LGW_file

SETSHAPE  [ ]

Specifies an image, which will be used from now on as a shape of each currently active turtle.

How is an Image Used to Depict the Shape of a Turtle

If the input is the name of an LGW file, it is the same as:

? SETSHAPE  LOADIMAGE  "LGW_file  [ ]

that is, LOADIMAGE is done automatically. If the word is specified without an extension, .LGW is added. If only partial or no path is specified within the given file name, the IMAGE subdirectory of the home directory is used to find the file. To change this setting, use SETPATH with "IMAGE as its first input.

The image normally used as the basic shape for Logo turtles (small triangle containing 24 frames) is saved in "TURTLE.LGW file. That is, any turtle created with MAKETURTLE is displayed as this shape. To redefine the basic turtle shape, insert following lines into the SLOGO.INI file:

TELL [ ]

SETSHAPE new_basic_shape

MAKETURTLE 0 ...	; etc.

TELL 0

If the input is an empty list [ ], the shape of each active turtle will be replaced by the basic shape (specified either by Logo as the triangle, or in SLOGO.INI file).


See also related procedures...

GETSHAPE

LOADIMAGE

GETIMAGE

IMAGE?

MAKETURTLE

WORD


Primitive Procedure - SETSHAPECOLOUR
SETSHAPECOLOUR   ---   command with 1 input

SETSHAPECOLOUR colour

SETSHAPECOLOUR [ ]

For each currently active turtle an active shape colour is set. The input colour must be one of the basic 16 colours. If the input is the empty list [ ], the active shape colour is set for all active turtles to "No", that is, from now on, these turtles have no colour specified as their active shape colour. In this case the SHAPECOLOUR operation will output [ ].

Notice that, although the active shape colour must be one of the basic 16 colours, it can be replaced in the shape (through the SETPENCOLOUR command) by any RGB colour.


See also related procedures...

SHAPECOLOUR

SETPENCOLOUR

PENCOLOUR


Primitive Procedure - SETLOGO: Advanced Features
SETLOGO   ---   advanced features

Some more options are available for key_word: PICKER, HIGHLIGHT, INDENT, HIDEPROBLEMS, MAXBMPCOLOURBITS, MAXIMAGECOLOURBITS, KEEPPALETTE, COMPRESSBMP, RIGHTCLICKS, CASE, FORMAT, SAVE16 and FKEYS

PICKER The value of PICKER  is a list of either English or local names of Logo primitive procedures. These names will then appear in the list box of the List of Commands Chooser and serve as a help tool for users who can pick them from there. It is useful to include commands here that have graphical choosers associated with them. The List of Commands Chooser appears on the screen by pressing F9 function key.

HIGHLIGHT is either 0 or 1. 1 is the default. If it is 1, all Logo language procedures' names and all words with special meanings will be highlighted by a set colour when typed in or displayed either in the Object Editor or in the File Editor. If it is 0, no words will be highlighted unless you turn the same option on in a particular Object Editor Window or File Editor Window. That means, the Highlight Primitives setting in the Main Window is global for the whole of Logo but may be overwritten in any particular editor window. To get the same effect as SETLOGO [HIGHLIGHT 1] or [HIGHLIGHT 0] turn the Options Menu Highlight Primitives command on or off.

INDENT  is either 0 or 1. 1 is the default. If it is 1, Logo automatically indents following an empty line in both Object or File Editors when you press the Enter key. The new line will start at the same column as the previous line. If it is 0, no spaces are inserted at the beginning of a new line after pressing Enter key, that is, the text cursor is placed in the first column, unless you turn the same option on in the Object Editor Window or File Editor Window. That means, the Indent option in SETLOGO is global for the whole of Logo but may be overwritten in any particular editor window. To get same effect as SETLOGO [INDENT 1] or [INDENT 0]  turn the Options Menu Indent in Editors command on or off.

HIDEPROBLEMS is either 0 or 1. The default is 1. If it is 0, then whenever you open the Problem Window  and start any Logo program, the problem window is not closed and remains on top of the graphics screen during the whole procedure (the default setting is that this window is first closed).

MAXBMPCOLOURBITS is 1, 4, 8 or 24. The default is 24. This parameter specifies the format of a graphics .BMP file to be created by SuperLogo when saving the screen or its part.

If MAXBMPCOLOURBITS option is set to 1, bitmaps will be saved as black and white. If it is 4, bitmaps will be saved as 16 colours graphics files with a standard palette. If it is 8 (and you are working in 256 colours mode or higher), the bitmaps will be saved as a 256 colours graphics files with palette. If it is 24 (and you are working in True Colour mode), the bitmaps will be saved as 16 777 216 colours graphics files (True Colour) without palette. For more details, see:

  Colour Transformations in Loading and Saving Graphics

MAXIMAGECOLOURBITS is 1, 4, 8 or 24. The default is 4. This parameter sets the graphics format of an image .LGW file to be created by SuperLogo when saving an image (into a file or into a Logo project)

If MAXIMAGECOLOURBITS option is set to 1, an image will be saved as black and white. If it is 4, an image will be saved as 16 colours image file with a standard palette. If it is 8 (and you are working in 256 colours mode or higher), the image will be saved as 256 colours image file with a palette. If it is 24 (and you are working in True Colour mode), the image will be saved as a 16 777 216 colours (True Colour) image file without a palette. For more details, see:

  Colour Transformations in Loading and Saving Graphics

KEEPPALETTE is either 0 or 1. The default is 0. If it is 0, any LOADSCREEN command with one input (i.e. LOADSCREEN which loads the whole screen) uses the Logo RESETPALETTE command before loading a new bitmap. Setting this option to 1 is only necessary in 256 colour mode, if the project loads screens but contains turtles and/or image variables with more than 16 colours and you want to prevent Logo from changing their palette after loading a new bitmap in the screen.

COMPRESSBMP is either 0 or 1. The default is 0. Turns on or off (if it is 1 or 0) compression of all bitmaps which are saved into any .BMP, .LGW or .LGP files. These files can be much smaller. Although the Paintbrush application is not able to load a compressed BMP file, some other Windows applications can (e.g. Word for Windows).

RIGHTCLICKS is either 0 or 1. The default is 1. If it is 0 and you click with the right mouse button in the graphics screen, nothing happens (that is, the shortcut menu doesn't open). It is also impossible to redefine buttons in the Buttons Window (by clicking them by the right mouse button). Logo also ignores grey + and - keys.

CASE    is either 0 or 1. The default is 0. If it is 0, the upper and lowercase letters are treated as equal in actions like <, > ... and also when searching for the name of a procedure, command, variable etc. That is, for example, Forward, FORWARD and forward names are considered to be identical. If it is 1, all above mentioned operations are case sensitive.

WARNING: we recommend you use this command only in the SLOGO.INI file, or it may cause some serious problems.

FORMAT is either 0 or 1. The default is 0. In this case, the number of decimal places displayed in the inspection window or the Object Editor Window of a variable with a real number value is always 18. If you set this option to 1, the number of decimal places displayed will be set by the current setting of SETFORMAT. Obviously, this setting never influences the internal precision of calculations with real numbers.

SAVE16 is either 0 or 1. The default is 0. This option switches on or off the 16 colours saving mode. If it is 1, all bitmaps and images which are stored into .BMP, .LGW or .LGP files contain only 16 colours, even if Windows is running in the 256 colours mode. Switching this option on can prevent Logo from creating big files when it runs in 256 or more colours Windows and the user in fact only works with the basic 16 colours. (Setting SAVE16 to 1 is equivalent to setting both MAXBMPCOLOURBITS and MAXIMAGECOLOURBITS to 4.)

FKEYS   is either 0, 1 or 12. The default is 1. If the input is 0, no function keys (except F12 - the stop command) and no keyboard shortcuts (except Ctrl+Break) are accepted by Logo while any instructions are running. If you, for example, press F5, Logo will not respond by showing the graphics screen etc. However, READKEY will output -59 if F1 was pressed, -60 if F2 was pressed... etc. through -69 if F11 was pressed.

If the input to FKEYS is 12, F12 will not be accepted as the stop command. In the case, the running program can be stopped from the keyboard only by pressing Ctrl+Break. If F12 is pressed, READKEY will output -70.

Alternatives:

choose Options menu Highlight Primitives,

choose Options menu Indent in Editors


Primitive Procedure - SETSHAPE: Advanced Features
SETSHAPE   ---   advanced features

SETSHAPE "Clipboard

Loads the contents of the Clipboard and uses it as a new shape for all currently active turtles. The contents of the Clipboard must have the LGW structure created beforehand for example by SAVEIMAGE directed to the Clipboard, or put onto the Clipboard by Cut or Copy in the Memory Window.

This instruction is the same as:

? SETSHAPE LOADIMAGE "CLIPBOARD [ ]


Primitive Procedure - SETTC
SETTC   ---   command with 1 input

set text colour

SETTC number

where number is an integer between 0 and 255, inclusive

Sets both colours of the text screen, that is, the colour of its background and colour of the text itself.

If you enter the input number in the form of 16*X + Y (both X and Y are integers between 0 and 15, inclusive), then number X indicates the colour of the text screen background and Y indicates the colour of the text. The basic setting of the text screen is 240, that is, 16 * 15 + 0.

? SETTC 16 * 8 + 7	; that is, 8 is background, 7 is text

From now on, light grey text would be printed on a dark grey background. To change both colours in the whole text screen immediately, use CLEARTEXT after setting the colours with SETTC.


See also related procedures...

CLEARTEXT

CURSOR

SETCURSOR

SETPROMPT


Primitive Procedure - SETTS
SETTS   ---   command with 1 input

set text screen

SETTS number

where number is an integer between 2 and 25, inclusive

Sets the number of lines that are displayed in the text screen when Logo is in the SPLITSCREEN mode in the Main Window.

By changing this number you change the portion of the graphics screen displayed, but you don't affect the actual size of the graphics screen (which can be set with SETGS), neither do you affect its contents. To find the currently set number of lines, use GETTS.

Alternatives:

you can set the number of lines in the Set Screens dialogue box which opens on the screen by selecting the Options Menu Set Screen... command in the Main Window,

the same dialogue box can be opened if you click the right mouse button anywhere in the graphics screen and choose Set Screens... in the pop-up menu.


See also related procedures...

GETTS

SETGS

GETGS

SETTC


Primitive Procedure - SETTTEXT; SETTT
SETTTEXT; SETTT   ---   command with 2 inputs

set turtle text

SETTTEXT  text  [num1  num2  num3 ]

SETTTEXT  text  [num1  num2  num3  num4  num5 ]

where

num1 is greater or equal to 0,

num2 is between 0 and 1000, inclusive,

num3, num4 and num5 is either 0 or 1

Sets the font and size in which all active turtles will print into the graphics screen if they are asked to use TTEXT.

First input, text gives the name of the font, for example "System or [Times New Roman] - the actual list of available fonts depends entirely on your Windows system. Num1 sets the size of the font (in points). If this input is 0, the default font size is selected. Num2 sets how bold the font will be. Value 400 here means Regular, value 800 means Bold. If num3 is 1, the style will be italic, otherwise, it will be regular. If the whole second input to SETTTEXT is [ ], the System font is selected.

? MAKETURTLE "OTTO [ ]

? TELL "OTTO

? SETTTEXT "Arial [20 800 0]

? REPEAT 3 [TTEXT [Happy birthday to you!] LT 120]

Use vector fonts (True Type, Adobe Type) if you want the turtle to print text at an angle.

Num4 - if present - is either 0 or 1. (If it is omitted, Logo considers it to be 0.) If it is 1, the whole rectangle into which the text will be printed by TTEXT will always be filled with the current background colour. (For RGB colours this option is not fully supported by Windows.) Num4 with the value 1 may be useful whenever you want to completely overwrite one text with another on the screen. Compare the following situations:

? SETTT "Arial [20 0 0 0] TT "Hello,
? WAIT 1000
? SETTT "Arial [30 0 0 0] TT "World

; and

? CS

? SETTT "Arial [20 0 0 1] TT "Hello,
? WAIT 1000
? SETTT "Arial [30 0 0 1] TT "World

Num5 specifies where the text will be written when TTEXT is used. If it is 0, the upper left corner of the rectangle into which the text will be printed is the position of the turtle. If it is 1, the beginning of the baseline of the text is the turtle's position. This helps you  write one long line of text in different font sizes:

; This does not look nice
? CS PU

? SETTT "Arial [20 0 0 0 0] TT "Hello,
? SETH 90 FD FIRST TEXTSIZE "Hello, SETH 0
? SETTT "Arial [30 0 0 0 0] TT "World

; This looks much better
? CS

? SETTT "Arial [20 0 0 0 1] TT "Hello,
? SETH 90 FD FIRST TEXTSIZE "Hello, SETH 0
? SETTT "Arial [30 0 0 0 1] TT "World

If the input numbers are not integers, they are first rounded by ROUND.


See also related procedures...

TTEXT

TEXTSIZE


Primitive Procedure - SETX
SETX   ---   command with 1 input

SETX  number

Moves each active turtle horizontally from its current position to a new X co-ordinate specified by the number. SETX doesn't change the turtle's heading or its Y co-ordinate. If the turtle's pen is PENDOWN, it draws a line while moving to its new X co-ordinate.

To find the X co-ordinate of the first active turtle, use XCOR. To find its current position, use POS. Beside SETX, SETXY, SETY, and SETPOS, the position of an active turtle is also changed with FORWARD, BACK, CLEARSCREEN, DRAW, and HOME.

Note that SETX number  is the same as SETPOS SE number YCOR.

? MAKETURTLE 1 [ ]	; here [ ] is the same as [0 0 0]

? MAKETURTLE 2 [ ]

? TELL [0 1 2]

? EACH [SETX 30*WHO-30]

? EACH [SHOW POS]

[-30 0]

[0 0]

[30 0]


See also related procedures...

POS

SETPOS

SETXY

SETY

XCOR

YCOR


Primitive Procedure - SETXY
SETXY   ---   command with 2 inputs

SETXY  number1  number2

Moves each active turtle to the point specified by X co-ordinate number1 and Y co-ordinate number2. SETXY doesn't change the turtle's heading. If the turtle's pen is PENDOWN, it draws a line while moving to its new position.

To find the current position of the first active turtle, use POS. Besides SETX, SETXY, SETY, and SETPOS, the position of an active turtle is also changed by FORWARD, BACK, CLEARSCREEN, DRAW, and HOME.

Note that SETXY number1 number2  is the same as  SETPOS SE number1 number2 .

? MAKETURTLE 1 [ ]	; here [ ] is the same as [0 0 0]

? MAKETURTLE 2 [ ]

? TELL [0 1 2]

? EACH [SETXY 30 * WHO 30 * WHO]

? EACH [SH POS]

[0 0]

[30 30]

[60 60]


See also related procedures...

POS

SETPOS

SETX

SETY

XCOR

YCOR


Primitive Procedure - SETY
SETY   ---   command with 1 input

SETY  number

Moves each active turtle vertically from its current position to a new Y co-ordinate set by the number. SETY doesn't change the turtle's heading or its X co-ordinate. If the turtle's pen is PENDOWN, it draws a line while moving to its new Y co-ordinate.

To find the Y co-ordinate of the first active turtle, use YCOR. To find its current position, use POS. Besides SETX, SETXY, SETY, and SETPOS, the position of an active turtle is also changed by FORWARD, BACK, CLEARSCREEN, DRAW, and HOME.

Note that SETY number  is the same as  SETPOS SE XCOR number.

? MAKETURTLE 1 [ ]	; here [ ] is the same as [0 0 0]

? MAKETURTLE 2 [ ]

? TELL [0 1 2]

? EACH [SETY 30 * WHO - 30]

? EACH [SH POS]

[0 -30]

[0 0]

[0 30]


See also related procedures...

POS

SETPOS

SETX

SETXY

XCOR

YCOR


Primitive Procedure - SHAPECOLOUR
SHAPECOLOUR   ---   operation with no inputs

SHAPECOLOUR

Outputs the active shape colour of the first active turtle. That is, the operation outputs either a number between 0 and 15, inclusive; or the empty list [ ], if no active shape colour has been specified for the first active turtle.

When you create a turtle (with the MAKETURTLE command or by using the shortcut right mouse button click in the graphics screen), the turtle has no active shape colour defined until you choose it with the SETSHAPECOLOUR command.


See also related procedures...

SETSHAPECOLOUR

SETPENCOLOUR

PENCOLOUR


Primitive Procedure - SHAPEPOS
SHAPEPOS   ---   operation with no inputs

SHAPEPOS

Outputs a rectangle [X Y width height ] covered in the graphics screen by the currently used frame of the first active turtle's shape.

First two numbers X and Y represent the first active turtle's actual position. If the first active turtle is currently hidden (by HIDETURTLE), the SHAPEPOS operation will output [X Y 0 0]. You will get the same output even if the turtle is not hidden but its current shape is an empty image, see also EMPTYIMAGE.


See also related procedures...

HOTSPOT

SETHOTSPOT

FRAME


Primitive Procedure - SHOW; SH
SHOW; SH   ---   command with 1 or N inputs

SHOW any

(SHOW any1 any2 ... )

Prints all specified inputs on the text screen, or into the output file, if the output stream has been redirected there by PRINTTO. If there are more inputs, they are printed with spaces separating them. SHOW moves the cursor to the beginning of the next line afterwards.

SHOW uses "technical" printing - it prints all brackets, see PRINT and TYPE.

? SH "SUPER

SUPER

? (SH "SUPER "LOGO)

SUPER LOGO

? SH [SHORT LIST]

[SHORT LIST]

? SH [VERY [COMPLICATED [LIST] ] ]

[VERY [COMPLICATED [LIST] ] ]

An image is printed in the form of {imageN}, where N is its number of frames. To see the image, use the Memory Window.

? MAKE "CARS LOADIMAGE "%IMAGE\\CARS [ ]

? SHOW :CARS

{image5}

Where to Use an Escape Character \


See also related procedures...

PRINT

TYPE

PRINTTO

TTEXT


Primitive Procedure - SHOWBUTTONS
SHOWBUTTONS   ---   command with no inputs

SHOWBUTTONS

Makes the Buttons Window appear on the screen. This is done independently of the actions of the buttons - the settings of the buttons are not changed by showing or hiding the Buttons Window itself.

To hide the chooser from the screen, use HIDEBUTTONS. To define or redefine the settings (the text/graphics and the action) of the buttons, use SETBUTTONS. To define the Buttons Window size, use SETBUTTONSSIZE. To find the current definitions of the buttons, use BUTTONS.

Alternative:

press function key F10


See also related procedures...

HIDEBUTTONS

SETBUTTONS

BUTTONS

BUTTONSSIZE

SETBUTTONSSIZE


Primitive Procedure - SHOWN?
SHOWN?   ---   operation with no inputs

SHOWN?

Outputs TRUE if the first active turtle is actually shown on the graphics screen. Otherwise, the output is FALSE.

To show all active turtles on the screen, use SHOWTURTLE. To hide all shown active turtles from the screen, use HIDETURTLE. To show one particular turtle (if there are many of them), use ASK.

? PU

? LT 90

? REPEAT 50 [FD 5 IF SHOWN? [HT] [ST] ]


See also related procedures...

HIDETURTLE

SHOWTURTLE

TRUE and FALSE


Primitive Procedure - SHOWSPEEDBAR
SHOWSPEEDBAR   ---   command with no inputs

SHOWSPEEDBAR

Makes the Speed Bar appear on the screen.

When the Speed Bar is hidden, the graphics screen can be made larger (for example, by pressing Default button in the Set Screens dialogue, see SETGS or SETTS). To specify the exact size of the Logo Main Window, use SETLOGOSIZE.

To hide the Speed Bar from the screen, use HIDESPEEDBAR.

Alternative:

Window Menu Show Speed Bar command in the Main Window.


See also related procedures...

HIDESPEEDBAR

HIDEBUTTONS

SHOWBUTTONS


Primitive Procedure - SHOWTURTLE; ST
SHOWTURTLE; ST   ---   command with no inputs

SHOWTURTLE

The command shows all active turtles' shapes on the screen.

To make the shapes of all active turtles disappear from the screen, use HIDETURTLE. To find out whether the first active turtle is currently shown, use SHOWN?. Drawing lines when turtle (or turtles) are shown, is much slower. Therefore it is sometimes helpful to hide all turtles from the screen.

To change the shape of all active turtles, use SETSHAPE with any image as its input.

? ST

? REPEAT 90 [FD 140 RT 172]

? PU

? BK 150

? PD

? HT

? REPEAT 100 [FD 80 RT 176]	; compare the speed of drawing

Alternatives:

grey plus key (on the number keypad) makes all active turtles become shown,

Shift + grey plus key (on the number keypad) makes all turtles (even those that are not currently active) become shown, see also About Other Keys in the Main Window.


See also related procedures...

HIDETURTLE

SHOWN?

STAMP


Primitive Procedure - SHUFFLE
SHUFFLE   ---   operation with 1 input

SHUFFLE  any

Randomly shuffles (rearranges) the order of elements of any and outputs the result.

Note that the output will be:

a word of the same number of characters, if the input is a word,

a list of the same number of members, if the input is a list. If any of the members is a list itself, its members will not be shuffled,

an image of the same number of frames, if the input is an image.

? SH SHUFFLE "BALLOON

LOALBNO

? SH SHUFFLE "BALLOON

OLOANLB

? SH SHUFFLE [1 2 3 [4 5] 6]

[3 [4 5] 2 6 1]


See also related procedures...

ITEM

PICK

GENERATE


Primitive Procedure - SIN
SIN   ---   operation with 1 input

SIN angle

Outputs the sine of the input angle (given in degrees).

? PR SIN 90

1

? PR ARCTAN (SIN 45) / COS 45

45

? PRINT ARCTAN SIN 45 / COS 45

; first of all COS is calculated, then /,

; after that, SIN and ARCTAN

41.86


See also related procedures...

ARCTAN

COS

TAN

SETFORMAT

and other Numeric Operations


Primitive Procedure - SOUND
SOUND   ---   command with 1 or N inputs

SOUND  list1

(SOUND  list1  list2 ... )

where

list1, list2 ... are lists containing even number of members, which are non negative numbers less then 65000

Plays a sequence of the tones specified in the list_of_numbers. Two successive numbers of the input list always mean one tone: the first number specifies its frequency, the second one its duration. Duration 1000 takes approx. 1 second.


See also related procedures...

PLAY

PLAYWAVE

MCI

OPENVIDEO

CLOSEVIDEO


Primitive Procedure - SPLITSCREEN; SS
SPLITSCREEN; SS   ---   command with no inputs

SPLITSCREEN

Sets the Main Window to both graphics and text screens. The number of lines displayed in the text screen can be changed with the SETTS or found with the GETTS.

The contents of the graphics screen is not affected by the SPLITSCREEN command, it is only temporarily covered by the text screen and is still active. That is, turtles can draw and move even beneath the text screen part of the Main Window. To set the entire Main Window to graphics, use the GRAPHICSCREEN command. The current contents of the text screen is not affected by SPLITSCREEN command either - it now shows only the most recent lines of it. To set the entire Main Window to text, use the TEXTSCREEN.

Alternatives:

Window Menu Split Screen of the Main Window,

F6 key, if the Main Window is active, or

Split Screen Button of the Main Window's Speed bar.


See also related procedures...

GRAPHICSCREEN

TEXTSCREEN

SETTS

SETGS


Primitive Procedure - SQRT
SQRT   ---   operation with 1 input

SQRT number

where number is always greater than or equal to 0

Outputs the square root of the input.

? MAKE "WHAT 5

? PR SQRT :WHAT

2.24

? REPEAT 3 [PR SQRT :WHAT MAKE "WHAT :WHAT+5]

2.24

3.16

3.87

? SETFORMAT 18

? PR SQRT 2

1,41421356237309505


See also related procedures...

EXP

LN

and other Numeric Operations


Primitive Procedure - STAMP
STAMP   ---   command with no inputs

STAMP

Each active turtle stamps its shape (its current frame) in the graphics screen. With the STAMP command the frame of the image becomes a part of the graphics screen's contents.

Do not confuse STAMP with PUTIMAGE, which prints the given image, not the shape of the turtle itself.

Here,  the only active turtle is 0 and its shape is the default (i.e. a small triangle):

? TELL 0

? PENUP

? ST

? REPEAT 24 [FD 45 STAMP RT 165]

? RT 90 FD 110


See also related procedures...

TTEXT

SETTTEXT

SETSHAPE

LOADIMAGE

PUTIMAGE


Primitive Procedure - STOP
STOP   ---   command with no inputs

STOP

Stops the running of the current procedure and returns control to the procedure which called this particular procedure. If there is no such procedure, control is returned to the top level, that is, to the dialogue level. STOP can only occur inside a user-defined Logo procedure.

Note the difference between OUTPUT and STOP: OUTPUT stops the running of the user-defined procedure as well. However, it also sets (with its input) what output the procedure will have, therefore it distinguishes operations from commands.

TO PRINT.LIST :Z

IF EMPTY? :Z [STOP]

PR FIRST :Z

PRINT.LIST BF :Z

END

? PRINT.LIST [A B C]

A

B

C


See also related procedures...

OUTPUT

DEBUG


Primitive Procedure - SUM
SUM   ---   operation with 2 or N inputs

SUM number1 number2

(SUM number1     )

SUM input1 input2   is the same as   input1 + input2

Outputs the sum of the two numbers. For more or less than 2 inputs you have to enclose the whole instruction in brackets.

? SH (SUM 22 33 44)

99

? IF SUM 3 4 = 3 + 4 [PRINT "O.K.] [PRINT "SORRY]

O.K.


See also related procedures...

DIFFERENCE

PRODUCT

QUOTIENT

and other Numeric Operations


Primitive Procedure - SYSTEMMETRICS
SYSTEMMETRICS   ---   operation with 1 input

SYSTEMMETRICS  number

SYSTEMMETRICS  word

It helps with creating our own screen layouts with buttons and problem windows etc. in situations when you need absolute screen co-ordinates. This operation is also useful in connection with SETLOGOSIZE. With SYSTEMMETRICS the Logo programmer can access the GetSystemMetrics Windows API call which reveals several sizes of Windows' elements, which has to be taken into account when designing exact screen layouts. Unlike Window's GetSystemMetrics, the SYSTEMMETRICS operation also outputs three important sizes which are used in Super Logo only.

Legal inputs and description of the corresponding output:

0	Width of screen.

1	Height of screen.

2	Width of arrow bitmap on a vertical scroll bar.

3	Height of arrow bitmap on a horizontal scroll bar.

4	Height of window title. This is the title height plus the height of the window frame that cannot be sized (Width of window frame that cannot be sized).

6	Height of window frame that cannot be sized.

7	Width of a typical dialogue window frame

8	Height of a typical dialogue window frame

9	Height of scroll box on vertical scroll bar.

10	Width of scroll box (thumb) on horizontal scroll bar.

11	Width of icon.

12	Height of icon.

13	Width of cursor.

14	Height of cursor.

15	Height of single-line menu bar. This is the menu height minus the height of the window frame that cannot be sized (Width of window client area for a full-screen window).

17	Height of window client area for a full-screen window (equivalent to the height of the screen minus the height of the window title).

18	Height of Kanji window.

19	Non-zero if the mouse hardware is installed.

20	Height of arrow bitmap on a vertical scroll bar.

21	Width of arrow bitmap on a horizontal scroll bar.

22	Non-zero if the Windows version is a debugging version.

23	Non-zero if the left and right mouse buttons are swapped.

28	Minimum width of window.

29	Minimum height of window.

30	Width of bitmaps contained in the title bar.

31	Height of bitmaps contained in the title bar.

32	Width of window frame that can be sized.

33	Height of window frame that can be sized.

34	Minimum tracking width of window.

35	Minimum tracking height of window.

36	Width of the rectangle around the location of the first click in a double-click sequence. The second click must occur within this rectangle for the system to consider the two clicks a double-click.

37	Height of the rectangle around the location of the first click in a double-click sequence. The second click must occur within this rectangle for the system to consider the two clicks a double-click.

38	Width of rectangles the system uses to position tiled icons.

39	Height of rectangles the system uses to position tiled icons.

40	Handle of the Pen Windows dynamic-link library (DLL) if Pen Windows is installed.

42	Non-zero if current version of Windows uses double-byte characters; otherwise, this value returns zero.

Super Logo related inputs and description of the corresponding output:

CXFONT - Width of the 'system fixed size' font's characters. This font is used in the text screen, in all text editors and in the problem windows (the width of the problem window is defined in multiples of this number)

CYFONT - Height of the 'system fixed size' font's characters. (the height of the problem window is defined in multiples of this number)

CYSPEEDBAR - Height of the Logo Speed bar. This is zero if the speed bar is hidden at the moment of SYSTEMMETRICS call.

? (PR [The width of this screen is] SYSTEMMETRICS 0 [pixels.])
The width of this screen is 640 pixels.

; I want to have a buttons window sized 100 x 87 pixels and
; always positioned in the bottom right corner of the screen
; regardless of its size:
? MAKE "w 100	; the width
? MAKE "h 87	; the height
? MAKE "x (SYSTEMMETRICS 0) - :w - SYSTEMMETRICS 5
? MAKE "y (SYSTEMMETRICS 1) - :h - ~
 (SYSTEMMETRICS 4) - SYSTEMMETRICS 6
? SETBUTTONSSIZE (LIST :x :y :w :h [My Buttons])


See also related procedures...

SETLOGO

SETLOGOSIZE

LOGO


Primitive Procedure - SUM: Advanced Features
SUM   ---   advanced features

SUM point1 point2

(SUM point1 ... )

Points represent Directed Line Segments ...

Points can also be compared ...

Outputs the point [a b ], where a is the sum of the first components of all input points and b is the sum of the second components of all these points.

If you consider points to represent directed line segments, point [a b ] is defined as the vector representing the sum of all input points - vectors.

? SETPOS SUM POS [25 35]

; if pen is PU, is the same as

? SETX XCOR + 25

? SETY YCOR + 35


Primitive Procedure - TAN
TAN   ---   operation with 1 input

TAN angle

Outputs the tangent of the input angle (given in degrees). This operation is not defined for inputs 90 + i * 180 (where i is an integer).

? PR TAN 45

1

? PR TAN 50

1.19

When restricted to the interval (-90, 90), TAN operation has an inverse, ARCTAN:

? SH TAN ARCTAN 72.5
72.5


See also related procedures...

SIN

COS

ARCTAN

and other Numeric Operations


Primitive Procedure - TELL
TELL   ---   command with 1 input

TELL  turtle

TELL  list_of_turtles

Makes the turtles named in the input become active. When Logo is started, the only existing and active turtle is turtle 0.

? SH WHO

0

? MAKETURTLE "ADDO [10 10 90]

? TELL [ADDO]

? REPEAT 4 [FD 60 RT 90]

To find the list of all active turtles (or a single name, if there is only one active turtle), use WHO. To change the order of turtles in this list, use REORDER.

Any existing turtle, either active or not, can be addressed with ASK to run a given list of instructions. Any turtle can be erased with ERASETURTLE.


See also related procedures...

ALLTURTLES

ASK

EACH

MAKETURTLE

ERASETURTLE

WHO

REORDER


Primitive Procedure - TEST
TEST   ---   command with 1 input

TEST logical

Remembers the input word - either TRUE or FALSE - for later use by IFTRUE and IFFALSE. TEST must occur in the same procedure in which you want to use its result.

Where to use TEST, IFFALSE, and IFTRUE Procedures

TO IS.GOOD? :WHAT

; is :WHAT bigger than 0 and less than 6?

TEST AND LESS? :WHAT 6 GREATER? :WHAT 0

IFT [PR [THIS IS THE CORRECT INPUT] ]

IFF [PR [I AM SORRY] ]

END

? IS.GOOD? 6

I AM SORRY

? IS.GOOD? 3

THIS IS THE CORRECT INPUT


See also related procedures...

IF

IFFALSE

IFTRUE


Primitive Procedure - TEXT
TEXT   ---   operation with 1 input

TEXT  word

where word  is the name of a user-defined procedure

Outputs a definition_list belonging to the user-defined procedure named by the word.

TEXT is used together with the DEFINE command to process programs as data.

TO DOUBLE2 :X

PR :X

OP 2 * :X

END

? SH TEXT "DOUBLE2

[ [X] [PR :X] [OP 2 * :X] ]

Note that the names of a procedure's inputs do not start with colon (:). To print the text of the definition in a more readable form, use the PRINTLINE command:

? PRINTLINE TEXT "DOUBLE2

X

PR :X

OP 2 * :X


See also related procedures...

DEFINE

DEFINED?

TO


Primitive Procedure - TEXTSCREEN; TS
TEXTSCREEN; TS   ---   command with no inputs

TEXTSCREEN

Sets the entire Main Window to text.

Current contents of the graphics screen are not lost, it is temporarily covered by the text screen and is still active, that is, turtles can draw and move even beneath the text screen. To set the entire Main Window to graphics, use the GRAPHICSCREEN command. To set it to both graphics and text screens, use the SPLITSCREEN command.

Alternatives:

Window Menu Text Screen command of the Main Window,

F7 key, if the Main Window is active, or

Text Screen Button of the Main Window's Speed bar.


See also related procedures...

GRAPHICSCREEN

SPLITSCREEN

SETGS

SETTS


Primitive Procedure - TEXTSIZE
TEXTSIZE   ---   operation with 1 input

TEXTSIZE  text

Outputs a list [width  height  ascent  external.leading] of four numbers. The first two numbers gives the size of a rectangle which would be covered if the first active turtle typed the text with TTEXT in the graphics screen - in its font and font size. Note that nothing is actually printed!

The third and fourth numbers of the output list are numbers giving some more advanced DTP features about the font.

To type the text, use TTEXT. To set or change the font and its size, use SETTTEXT.


See also related procedures...

SETTTEXT

TTEXT


Primitive Procedure - THING
THING   ---   operation with 1 input

THING word

where word  is the name of a variable

Outputs the value of the variable word . This value must have been created by MAKE or NAME (or, for the names of inputs of a user-defined procedure, when the procedure is activated).

THING is a primitive that is normally replaced by dots :, that is, THING "A refers to the same value as :A.

? MAKE "NAME "OTTO

? SH "NAME

NAME

? SH THING "NAME

OTTO

? SH :NAME

OTTO

If the variable word 's value is an image, THING outputs it in the following notation: {imageN }, where N is the number of frames of the image.

Alternative:

in the Memory Window all names and values of global variables are listed and can be inspected and modified there. These names are marked with [image] or [image] icons.


See also related procedures...

MAKE

NAME

NAME?


Primitive Procedure - THROW
THROW   ---   command with 1 input

THROW  word

Stops the currently running user-defined procedure and keeps stopping higher-level procedures until it reaches the matching CATCH command whose first input is exactly the same word.

CATCH and THROW commands must be used in pairs. Be careful when using them.

? CATCH "HERE [PRINT "A THROW "HERE PRINT "B]

A

? 	; word A was printed, the rest of the list was not used

If THROW cannot find any matching CATCH command, control is returned to the top, that is, to the dialogue level. The same happens when you use THROW "TOPLEVEL without any CATCH at all, see the special word TOPLEVEL.

Because CATCH and THROW can be used for stopping not only the procedure where THROW is used but also its calling procedure, the procedure calling the procedure calling this procedure etc., that is, a part or even the whole chain of active procedures, together they are called 'super-STOP'. (Compare it with STOP, which stops only its own procedure.)


See also related procedures...

CATCH

TOPLEVEL

STOP


Primitive Procedure - TIME
TIME   ---   operation with no inputs

TIME

Outputs a list of four numbers [hours minutes seconds hundredths_of_second ] that correspond to the time set in your computer.


See also related procedures...

TIMEWORD

DATE

DATEWORD


Primitive Procedure - TIMEWORD; TIMEW
TIMEWORD; TIMEW   ---   operation with no input

TIMEWORD

The operation takes the time from the computer and formats it in the standard way according to the time format defined in the Windows Control Panel's International option. TIMEWORD outputs this information as a Logo word, like 13:48:50, 1:48:50 PM or 1h48m P.M.).

? PR TIMEWORD
14:23:54	; depends on actual settings of your Windows system


See also related procedures...

TIME

DATE

DATEWORD


Primitive Procedure - TO
TO   ---   command with 1 or N inputs

TO  word

TO  word  :input1  :input2 ...

where

word is neither the name of a Logo primitive nor the name of any user-defined procedure,

input1, input2, ... are words

Changes the Logo dialogue mode into the procedure definition mode. The prompt of the dialogue is replaced by a special prompt > to let you know that you are defining a procedure.

The word gives the new procedure's name, other inputs :input1, :input2, etc. specify the names of the new procedure's inputs.

In the lines following TO you type the body of the new procedure. Note that the procedure definition mode allows only line editing commands. You finish the definition by typing END on a separate line.

? TO SQUARE :SIZE

> REPEAT 4 [FD :SIZE RT 90]

> END

?	; normal dialogue mode is restored

See also:

How You Distinguish Between Commands and Operations

Alternative Ways How to Define Procedures


See also related procedures...

EDIT

END

DEFINE

TEXT


Primitive Procedure - TOPLEVEL
TOPLEVEL   ---   word with special meaning

THROW "TOPLEVEL

Stops the current user-defined procedure and keeps stopping also all higher calling procedures until the control is returned to the top, that is, to the dialogue level of Logo.

Try to understand TOPLEVEL with CATCH and THROW commands together. Be careful when using them.

THROW "TOPLEVEL is different from STOP. STOP makes Logo only stop the current user-defined procedure and return to the calling procedure.


See also related procedures...

THROW

CATCH

STOP


Primitive Procedure - TOUCHED
TOUCHED   ---   operation with no inputs

turtle clicked at, that is, turtle "touched" by mouse

TOUCHED

When used after the READKEY operation, TOUCHED outputs the name of a turtle which has been clicked most recently by the left mouse button. Turtles which are currently hidden by HIDETURTLE are not taken into account. However, all shown turtles, that is, both active and passive, respond to TOUCHED.

For a turtle "to be clicked" means that the position where the left mouse button has most recently been clicked lies anywhere within the turtle's shape.

If the most recent left mouse button click lies outside any turtles' shapes, the output is an empty list [ ]. If there are currently more turtles with overlapping shapes, TOUCHED outputs the name of the youngest turtle among them. This turtle is always on the top of others (which is important for animation - to change this, use REORDER).


See also related procedures...

MOUSE

READKEY

CODEAREA


Primitive Procedure - TOWARDS
TOWARDS   ---   operation with 1 input

TOWARDS point

TOWARDS turtle

Outputs a heading which the first active turtle should take to face towards the position set by the point. The heading is measured in degrees clockwise from North. If the input is a turtle, the output is a heading which the first active turtle should take to face this turtle.

Note that the output of TOWARDS is not the angle by which the turtle should turn left or right to face the given point. However, the output could be used by SETHEADING, for example.

? MAKETURTLE "EVE [60 40 0]

? TELL 0 FD 40	; make the only active turtle be 0

? SETH TOWARDS ASK "EVE [POS]	; make 0 face towards EVE

? SH HEADING

90


See also related procedures...

HEADING

POS

SETHEADING


Word with Special Meaning - TRUE
TRUE   ---   word with special meaning

It represents the logical value true or yes. It is used as input to conditional procedures like IF and TEST, and logical operators AND, OR, and NOT.

? SH AND "TRUE "TRUE

TRUE

? SH 6 = 2 + 3

FALSE


See also related procedures...

FALSE

AND

OR

NOT

TEST

IF

IFFALSE

IFTRUE


Primitive Procedure - TTEXT; TT
TTEXT; TT   ---   command with 1 or N inputs

TTEXT  text

(TTEXT  text1  text2 ... )

Makes each active turtle print the given text or texts in the graphics screen at its position and in the font and size set previously by SETTTEXT.

Text1, text2, ... are printed in the colour of each turtle's pen (even if the pen is currently PENUP, however, this option is not correctly supported by Windows for RGB colours of the pen). If any of inputs text1, text2, ... are lists, TTEXT prints them without the brackets - similar to PRINT in the text screen.

The inputs are printed perpendicular to the turtle's heading, that is, if it faces the North, text will be printed in the horizontal line. For certain fonts, it is possible to print in any direction.


See also related procedures...

SETTTEXT

TEXTSIZE


Primitive Procedure - TURTLESTATE
TURTLESTATE   ---   operation with no inputs

TURTLESTATE

Outputs a list of 6 members [X Y angle word1 word2 image] describing the state of the first active turtle. [X Y] is its position, angle is its heading, word1 is one of PD, PU, PE or PX depending on whether its pen is PENDOWN, PENUP, PENERASE or PENREVERSE. Word2 is either ST or HT depending on whether the turtle is SHOWN? or hidden. Image is the turtle's shape.

To change the position of the turtle, use the FORWARD or BACK (or several other) commands. To change its heading, use RIGHT or LEFT. To change the pen mode, use any of the PENDOWN, PENUP, PENERASE or PENREVERSE commands. To show a hidden turtle, use SHOWTURTLE. To hide a shown turtle, use HIDETURTLE. To set an image to a turtle as its new shape, use SETSHAPE.


See also related procedures...

PENSTATE

SETPENSTATE

and other Turtle Geometry procedures


Primitive Procedure - TYPE
TYPE   ---   command with 1 or N inputs

TYPE  any

(TYPE  any1  any2 ... )

Prints the inputs on the text screen, or to the output file, if the output stream has been redirected there by PRINTTO. Printed inputs are not separated by spaces, neither is the cursor moved to the next line (compare TYPE with SHOW and PRINT).

? TYPE "HELLO

HELLO? 	; the prompt appears after the last printed character

TYPE removes the outer brackets if the input is a list. An image is printed in the form of {imageN}, where N is its number of frames. To see the contents of the image, use the Memory Window.

? TYPE [A B [1 2] C D]

A B [1 2] C D?

? MAKE "CARS LOADIMAGE "%IMAGE\\CARS [ ]

? TYPE :CARS

{image5}?

Where to Use an Escape Character \

? TYPE "C\73A\-KGB

? CIA-KGB?


See also related procedures...

PRINT

SHOW

PRINTLINE

PRINTTO


Primitive Procedure - UNBURY
UNBURY   ---   command with 1 input

UNBURY memory_object

UNBURY list_of_memory_objects

How and Why You Bury Memory Objects...

Creating and Using a Library...

It makes the user-defined object or objects not buried any more (unlike SETBURY "FALSE which makes all buried objects only temporarily visible).

To find all buried objects, use BURIED. To unbury all buried objects in one step, type in UNBURY BURIED.

? SH BURIED

[A B :VAR22 "WHO.IS.WHO]

? UNBURY [A :VAR22]

? SH BURIED

[B "WHO.IS.WHO]

Alternative:

Show Also Buried in the Objects Menu of the Memory Window


See also related procedures...

BURY

BURYALL

BURIED

SETBURY


Primitive Procedure - WAIT
WAIT   ---   command with 1 input

WAIT number

where number is a positive number not greater than 65535

Causes Logo to stop what ever it's doing for the number of milliseconds. WAIT 1000  stops for approximately one second.


See also related procedures...

WAITUNTIL


Primitive Procedure - WAITUNTIL
WAITUNTIL   ---   command with 1 input

WAITUNTIL [expression ]

Checks the input expression repeatedly until its value is TRUE.

? WAITUNTIL [KEY?]

; waits until any key or mouse button is  pressed
? WAITUNTIL [READKEY = -2]

; waits until the mouse button is released


See also related procedures...

WAIT


Primitive Procedure - WHILE
WHILE   ---   command with 2 inputs

WHILE  [ expression ]  list_of_instructions

Logo first works out the expression. If its value is TRUE, Logo continues with all instructions in the list_of_instructions. Then it checks the expression once more. If its value is TRUE, Logo does all instructions of the list_of_instructions again. This process is repeated while the expression is TRUE.

? TELL 0 PD

? MAKE "H HEADING

? FD 10 RT 5

? WHILE [:H <> HEADING] [FD 10 RT 5]

Note that within the list_of_instructions you can also use REPCOUNT to find the number of repeats that have been done.


See also related procedures...

FOR

FOREACH

WAITUNTIL

REPEAT

MAP


Primitive Procedure - WHO
WHO   ---   operation with no inputs

WHO

Outputs the name of the turtle, if it is the only active turtle. Otherwise it outputs the list of all currently active turtles.

This list can be changed with TELL. Be careful not to confuse WHO with the output of  ALLTURTLES, which outputs the list of all currently existing turtles, i.e. both active and non-active ones.

The order of the turtles in WHO list is the order in which you created them with MAKETURTLE. This order, however, can be changed with REORDER. WHO is often used with EACH.

? SH WHO

0

? SH ALL

[0]


See also related procedures...

ALLTURTLES

ASK

EACH

ERASETURTLE

MAKETURTLE

TELL


Primitive Procedure - WINDOW
WINDOW   ---   command with no or 1 input

WINDOW

(WINDOW rectangle )

(WINDOW [ ])

For each active turtle the command sets the area in which that turtle is visible, in which it can draw a line, draw a polygon with POLYGON or POLYGONLINE, in which it can print text with TTEXT, in which it can FILL etc.

If the command has no input and no area has been set for this particular turtle before, it makes the area for the turtle fit the graphics screen. If the input is a rectangle, it sets a new area. If the input is an empty list [ ], it resets any previous setting and defines its area as the whole graphics screen again.

The WINDOW command also sets out how the turtle will act whenever it reaches the border of its area. If it is set in window mode, it can move (with FORWARD or other commands) beyond the borders of its area with no limitations except that it can't be seen there and it can't draw lines or print there. Its area represents a kind of window through which you can watch a part of the "unlimited" turtles' plane.

When a turtle is created with MAKETURTLE, it is always in wrap mode with its area being the whole graphics screen. To change it to the window mode, make it active and use WINDOW. To turn it back to wrap mode, use WRAP.

If a turtle moves far away and is "lost" somewhere in its "unlimited" plane, you can find its current position with POS and bring it back to its home position with HOME. It is sometimes useful to have some turtles in the wrap mode and others in the window mode in at the same time.


See also related procedures...

WRAP

GETWINDOW


Primitive Procedure - WORD
WORD   ---   operation with 2 or N inputs

WORD  word1  word2

(WORD  word1  ... )

Outputs a word formed by joining all input words. Input words may be empty.

? PR WORD "Win "dows

Windows

? PR (WORD 23 ". 7)

23.7

? SH NUMBER? (WORD 23 ". 7)

TRUE

Sometimes you have to work with words that contain special characters, like A/B or A B - that is, a word which contains a space. Then you have to use the escape character.

? SH (WORD "A "\32 "B)

A B	; this word contains a space


See also related procedures...

EMPTY?

LIST

LIST?

SENTENCE

WORD?


Primitive Procedure - WORD?
WORD?   ---   operation with 1 input

WORD? any

Outputs TRUE if the input is a word, that is, either a text or numeric word (number). Otherwise the output is FALSE.

? SH WORD? "SUPER.LOGO

TRUE

? SH WORD? LAST [AHA EHE UHU]

TRUE

? SH WORD? BUTLAST "E

TRUE	; an empty word is also word

Sometimes you have to work with words that contain special characters, like A/B or A B - that is, a word which contains a space. Then you have to use the escape character:

Escape Character \ and "Forbidden Words"...

? SH (WORD "JOE CHAR 38 "JIM)

JOE&JIM

? SH WORD? (WORD "JOE CHAR 38 "JIM)

TRUE


See also related procedures...

EMPTY?

LIST?

NUMBER?

WORD

IMAGE?

TRUE and FALSE


Primitive Procedure - WRAP
WRAP   ---   command with no or 1 input

WRAP

(WRAP rectangle )

(WRAP [ ])

For each active turtle the command sets the area in which that turtle is visible, in which it can draw a line, draw a polygon with POLYGON or POLYGONLINE, in which it can print text with TTEXT, in which it can FILL etc.

If the command has no input and no area has been set for this particular turtle, it defines the area for the turtle as the whole graphics screen. If the input is a rectangle, it sets the area. If the input is an empty list [ ], it resets any previous setting and defines its area as the whole graphics screen again.

The WRAP command also tells the turtle how to act whenever it reaches the border of its area. If it is in wrap mode, it always remains in the graphics screen no matter how large the movements (with FORWARD or other commands) it makes. Any time any "wrapped" turtle moves off the screen, it automatically wraps around it and appears on the opposite border of the graphics screen.

When a turtle is created with MAKETURTLE, it is in wrap mode. To change it to window mode, make it active and use WINDOW. It is sometimes useful to have some turtles in wrap mode and others in window mode at the same time.

? CS

? RT 5.3

? FD 25000


See also related procedures...

WINDOW

GETWINDOW


Primitive Procedure - XCOR
XCOR   ---   operation with no inputs

XCOR

Outputs the X co-ordinate of the first active turtle's position.

To change the current X co-ordinate of any active turtle's position, use SETX. Its position can be also changed by FORWARD, BACK, SETPOS, SETXY, SETY , CLEARSCREEN, DRAW  or HOME.

? MAKETURTLE "VIERA [100 -50 135]

? ASK "VIERA [SH XCOR]

100

Note that XCOR is the same as the instruction FIRST POS.


See also related procedures...

POS

SETPOS

SETX

SETY

YCOR


Primitive Procedure - YCOR
YCOR   ---   operation with no inputs

YCOR

Outputs the Y co-ordinate of the first active turtle's position.

To change the Y co-ordinate of any active turtle's position, use SETY. Its position can be also changed with FORWARD, BACK, SETPOS, SETXY, SETX , CLEARSCREEN, DRAW  or HOME.

? MAKETURTLE "VIERA [100 -50 135]

? ASK "VIERA [SH YCOR]

-50

Note that YCOR is the same as the instruction LAST POS.


See also related procedures...

POS

SETPOS

SETX

SETY

XCOR


Primitive Procedure - TIMEWORD; TIMEW: Advanced Features
TIMEWORD; TIMEW   ---   advanced features: 1 or 2 inputs

(TIMEWORD  time_format )

(TIMEWORD  time_format  time )

The operation may use an optional time_format input that specifies the format according to which Logo modifies the output word. The time_format is a list containing the following members:

hhhh	hour in 24-hour format with additional zero (00 to 24),
hhh	hour in 24-hour format with no additional zero (0 to 24),
hh	hour in 12-hour format with additional zero (01 to 12),
h	hour in 12-hour format with no additional zero (1 to 12),
mm	minutes with additional zero (00 to 59),
m	minutes with no additional zero (0 to 59),
ss	seconds with additional zero (00 to 59),
s	seconds with no additional zero(0 to 59),
xx	hundredths of second with additional zero (00 to 99),
x	hundredths of second with no additional zero (0 to 99),

'string'	the string which should appear in the result (without quotes - quotes inside the string must be doubled).

All other characters in the time_format will appear in the result of the TIMEWORD operation. Some pre-defined values of time_format can be used as well:

[ ] 	denotes "complete" standard Windows time format without the hundredths of second,

"  	(empty word) denotes "complete" standard Windows time format with hundredths of second.

Time_format may also be in the form [ time_format1  time_format2 ]. It means that time_format1 should be used for AM and 11:59 and time_format2 PM.

The optional second input time is a time in one of the following formats: [ ], [hour], [hour minute], [hour minute second], [hour minute second hundredths]. The TIMEWORD operation will output the specified time reformatted into the format set by the time_format. If the time is [ ], then the output of TIMEWORD will not be the time formatted according to the given format, but the format itself (this enables you to get the standard Windows time format by typing MAKE "x (TIMEWORD [ ] [ ])):

? PR (TIMEW [ ] [ ])

[ [h:m:s 'AM'] [h:m:s 'PM'] ]

? PR (TIMEW [hhhh'h':mm'm':ss's'])
14h:23m:54s
? PR (TIMEW [ [hh:mm:ss 'AM'] [h:mm:ss 'PM'] ] [14 30 25])
2:30:25 PM
? PR (TIMEW [ [hh:mm:ss 'AM'] [h:mm:ss 'PM'] ] [10 30 25])
10:30:25 AM


Primitive Procedure - TO: Advanced Features
TO   ---   advanced features

TO  word  :input1  [number ]

where number is any non negative integer and input1 is a word

Changes the Logo dialogue mode to the procedure definition mode in which you create a user-defined procedure with variable number of inputs.

How to define procedures with variable number of inputs


Primitive Procedure - UNBURY: Advanced Features
UNBURY   ---   advanced features, command with N inputs

(UNBURY input1  input2 ... )

where each input is either a memory_object or a list_of_memory_objects

It is sometimes easier to specify more than one object or more than one list of objects to be unburied at once. So:

? MAKE "A [F G H]

? MAKE "B [:Var1 :Var2]

? BURY SE :A :B

? UNBURY SE :A :B	; is equivalent to

? (UNBURY :A :B)


Keyboard Shortcuts in the Editor
    Keyboard Shortcuts in the Editors

The contents of the Editor Window (either Object Editor or File Editor) can be edited with any of the following keys:

Right arrow moves the text cursor one character to the right,

Left arrow moves the text cursor one character to the left,

Ctrl+right arrow moves the text cursor one word to the right,

Ctrl+left arrow moves the text cursor one word to the left,

End moves the text cursor to the end of the line,

Home moves the text cursor to the beginning of the line,

Del deletes one character at the current cursor position (or the whole selected text),

Back Space deletes one character to the left of the text cursor (or the whole selected text).The rest of the line together with the cursor itself is moved one character to the left,

Up arrow moves the text cursor one line up,

Down arrow moves the text cursor one line down,

Page Up moves the text cursor one window contents up,

Page Down moves the text cursor one window contents down,

Ctrl+Home moves the text cursor to the start of the window contents,

Ctrl+End moves the text cursor to the end of the window contents.


I belong to ...

  On Object Editor Window


  Editing Properties of a Word

Properties of a word are defined by PPROP or SETPLIST  and can be shown either in the text screen with PLIST or in that word's inspection window in the Memory. All properties of a word form the property list.

However, the property list in the Memory (that is, in the word's inspection window and in the Object Editor) is always displayed in the form:

name1  value1 ~

name2  value2 ~

. . .

nameN  valueN

When editing the word's property list:

you can put it all in brackets - however, Logo will not display them when the Editor is closed (and opened again),

you must keep the property list's structure - all odd elements must be words, that is, names of properties, and all even elements can be any Logo value. If the value of a property is an image with M frames, in the property list it is substituted with {imageM} and the Object Editor is not able to edit this structure (although the structure is correct and all properties can be used in any valid way).

If, in the Editor Window, you delete all properties from the list of properties or you type in only an empty list [ ], after closing the Editor the object (the word with properties) is removed completely from the Memory - it is not listed in the List of Objects.


  Editing Value of a Variable

The contents of the Object Editor in this case is a word or a list (not an image - in that case the Image Editor would be opened instead). If you type in a word in the Object Editor Window, the value of the edited variable will be this word. If you type in a list, the value of the edited variable will be this list. The same is true if you type in several Logo words or lists separated from each other (two words must be separated by a space). For example, if you type in:

333 HELLO [ A B C ] [ 66 77 ] "FIRST

the value of the variable will be the list:

[ 333 HELLO [ A B C ] [ 66 77 ] "FIRST ]

If you type nothing in the Editor Window, the value will be an empty word. If you type [ ], the value will be an empty list. If the variable's value is a list containing an empty word as its element, it will not be correctly displayed and can't be correctly edited in the Object Editor (but can be correctly used in our programs).


  Editing Definition of a Procedure

When defining or editing the procedure's definition, you must keep the legal definition's structure. However, the final line with only the word END can be left out - Logo will insert it in the definition when the Object Editor is closed. If the structure of the definition is not correct, an error message appears and you are forced to fix the problem - otherwise you can't finish editing.

The name of a procedure in the first line of its definition can be changed. In this case the original procedure's definition will not be modified and a new procedure is created with this changed name. This is a convenient way to quickly define a new procedure with a similar definition - you start the Object Editor for the original procedure, change its name and its definition and close the Editor.

In the Object Editor Window you can define only one procedure at a time, it is open to edit one user-defined object. (The other definition in the same window would be ignored.)


  Closing the Object Editor

You can close the Object Editor either by:

pressing the F12 function key,

choosing End Editing in the Memory Window, if the Editor was opened from here and is still on the screen,

clicking the minimisation icon of the Editor with the mouse, or with any other standard method of  closing a window through its control menu icon.

In all of these options, Logo will first check the new contents of the edited object and accept it, that is, modify it in the Memory Window, if the contents is correct.

If you want to reject the changes you have just made in the Object Editor Window and return to the object's previous contents, press Esc. Logo will ask whether you want to accept the modified contents. Here you can answer either Yes or No or Cancel the operation. The same will happen if you choose Edit for another object before you close the Editor for the object currently being edited.


  Object Editor

The Object Editor makes it possible to create or modify the "textual contents" of any user-defined object. You can open it from the Memory Window or from the text screen with Logo primitive command EDIT.

Editing Definition of a Procedure

Editing Value of a Variable

Editing Properties of a Word

  Menu Bar

  Other Features

  Right Mouse Button in the Object Editor


  Object Editor

The Object Editor makes it possible to create or modify the "textual contents" of any user-defined object. You can open it from the Memory Window or from the text screen with Logo primitive command EDIT.

Editing Definition of a Procedure

Editing Value of a Variable

Editing Properties of a Word

  Menu Bar

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands

  Commands Command

  End Command

  Other Features

  Right Mouse Button in the Object Editor


  Object Editor

The Object Editor makes it possible to create or modify the "textual contents" of any user-defined object. You can open it from the Memory Window or from the text screen with Logo primitive command EDIT.

Editing Definition of a Procedure

Editing Value of a Variable

Editing Properties of a Word

  Menu Bar

  Other Features

  What You Can Do Outside the Editor While Editing

  Keyboard Shortcuts in the Editors

  Drag and Drop

  Closing the Object Editor

  Right Mouse Button in the Object Editor


  Edit Menu Commands (in the Object Editor)

To learn more about any command, click on  it in the picture with your mouse.

  Menu Bar

  Edit Menu Commands

Commands in this menu allow you to move texts within the Object Editor Window, or even outside it with the help of the Clipboard. To copy any text to the Clipboard, you must select it first. The contents of the Clipboard can then be pasted into another procedure's definition, variable's value etc. It can also be pasted directly into the command line of the text screen.


I belong to ...

  On Edit Menu in Object Editor


  Search Menu Commands (in the Object Editor)

To learn more about any command, click on it in the picture with  your mouse.

  Menu Bar

  Edit Menu Commands

  Search Menu Commands

You can use commands of this menu to search for and / or replace text in the active Object Editor.


I belong to ...

  On Search Menu in Object Editor


  Options Menu Commands (in the Object Editor)

To learn more about any command, click on it in the picture with  your mouse.

  Menu Bar

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands


Picker Command (in the Object Editor)
  Commands Command (in the Object Editor)

To learn more about any command, click on it in the picture with  your mouse!

  Menu Bar

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands

  Commands Command

Opens either:

  List of Commands dialogue box which allows you to choose a Logo primitive command and fill in its inputs (by typing them in after pressing Write it! button, or automatically in a chooser after pressing the Inputs button),

   a chooser, if the text cursor is located to the right of a command name which has it own chooser. There you set the inputs for the command.

When you close the List of Commands Window or a chooser in a normal way (with the Write it! button), the name of the command itself or the name of the command plus its inputs are automatically written in the Object Editor at the cursor.


  End Command

To learn more about any command, click on it in the picture with  your mouse.

  Menu Bar

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands

  Commands Command

  End Command

Closes the Object Editor and updates the contents of the object just edited. If the editor has been opened from the Memory Window, the updated contents of the object are displayed in its inspection window.

  Shortcut Key: F12

  Mouse Shortcut: click the minimisation icon of the Editor, or use any other standard way of closing the window,

  From the Memory Window: choose End Editing.


Drag and Drop
    Drag-and-Drop Editing

The drag-and-drop text editing feature allows you to move text within the Object Editor Window or within the File Editor Window, however, not from one window to the other. To Drag-and-Drop, you have to:

select the text you want to move,

drag the text to a new location anywhere within the window. While dragging, the cursor changes its shape to show the drag-and-drop feature. To insert at the new location, you just place the cursor's vertical bar at the position where the text should start. When you release the left mouse button after dragging the text to its new location, it is inserted there.

If you try to move the text outside the window, the vertical bar starts to blink and Logo doesn't allow you to do so.


  What You Can Do Outside the Editor While Editing

If you open the Object Editor from the Memory Window (that is, not from the text screen with the EDIT Logo primitive command), some operations can still be performed in the Memory Window; you can select and inspect any other object, you can choose any of the Options Menu commands, you can bury or unbury other objects which you have selected in the List of Objects, you can hide the Memory Window etc.

If you choose to open the Object Editor while still editing another object, you are asked to confirm or reject the new contents of the modified object first. Only after this is the Editor opened with the contents of another object.


Selecting text in the Editor
    Selecting Text...

If you want to select:

any text - you just drag across the text, or you click at one end of the text you want to select, then press and hold the Shift key and click the other end of the text,

a word - you double-click the word,

a line - you press and hold the Ctrl key and click the line.

You can also select it using keys:

any text - you move the text cursor to one end of the text you want to select, press and hold the Shift key and move the cursor to the other end of the text,

to the beginning of this word - you press Ctrl+Shift+Left arrow,

to the beginning of the next word - you press Ctrl+Shift+Right arrow,

to the beginning of the line - you press Shift+Home,

to the end of the line - you press Shift+End,

to the start of the text - you press Ctrl+Shift+Home,

to the end of the text - you press Ctrl+Shift+End.


Image Editor
  MegaPaint - Image & Graphics Editor

MegaPaint, version 1.1, is a powerful image, icon and bitmap editor. In working with SuperLogo, MegaPaint makes it possible to create or modify images, that is, values of variables of the image type or shapes of turtles (compare it with the Object Editor which creates or modifies variables of text type, procedures and properties). Beside this it can create or modify .LGW files, .ICO files, and bitmaps (maximum size 255 x 255 pixels). MegaPaint provides several basic and advanced tools for drawing and filling, writing text (of any font and size), inserting regular geometric shapes (lines, circles, rectangles, ellipses, filled ellipses), fully linked to the Clipboard, shrinking & growing feature, reductions, rotations, colour replacements and much more. It also contains a special Frame Animation Window for developing and stepping through an animation - that is, sequences of frames in an image. It also helps with the development of Windows-like buttons. It supports two filling modes and many other advanced graphics operations.


Problem Window
  Problem Windows

After choosing a problem in the Problems Window or running LOADPROBLEM, a new window appears on the screen containing the problem to be solved. In its title bar you see the name of the problem you have chosen. Its working area contains the text of the problem and/or some pictures (bitmaps or images). If the text is too large to fit into one screen, a vertical scroll bar is added automatically. The text of the displayed problem can't be edited or copied, it can only be read. However, new projects can be developed by anyone:

  How to Produce Your Own Problem

The Problem Window can't be minimised, it can only be resized and moved, maximised, or closed. The window can also be closed with CLOSEPROBLEM

If you have a Problem Window displayed in the screen, it will not disappear until you close it - you can even open other windows (like Memory Window, File Editor Window or Step by Step Window) and still keep the window open till the problem is solved. Beside this, more Windows with Problems can be open within the Main Window at the same time. However, you can't open the same problem twice.


  How to Produce Your Own Problem File

The contents of the Problem Window is an ordinary .TXT file and can be created or modified in any text editor able to produce or export plain text files, for example in the SuperLogo File Editor. The .TXT file must be saved into the PROBLEM sub directory (or into any other directory which you specify with SETPATH with the PROBLEM keyword).

The first line of the file may start with a # character followed by one, two, three or four numbers separated by commas (with no spaces). These positive integers W,L,X,Y (if given) specify:

  the basic width of the window (defining the maximum number of characters per line). The window may be resized manually (when open), but the Cascade command will arrange it and display in its basic width. The number must be bigger than 8,

  the number of lines displayed in the window,

  third and fourth of these numbers set the X and Y co-ordinates of the upper-left corner of the window as its default position to appear.

These numbers are optional and not all of them must be specified. The # character may be followed by some other characters with the following meaning:

#!	- the problem window will not be sizeable,

#%	- the problem window will not be moveable,

#!%	- the problem window will be neither sizeable nor moveable.

The rest of the first line (i.e. everything what follows the first space) is considered to be the Title of the Problem. This text is listed in the Problem dialogue box instead of the file names. Therefore, the title may consist of several words separated by spaces.

Each paragraph must start with an empty line. To leave one empty line in the final Problem Window, you have to insert two empty lines into the text file at the corresponding place. If you want to insert an unbreakable space (which will never be the last character of the line), replace it with @ character, e.g. FORWARD@40.

If you want to insert a bitmap picture into the text, first you have to create it as standard .BMP file, for example in SuperLogo with SAVEBITMAP or SAVESCREEN, and save it in the directory where all Problems are saved (or specify its complete or partial path). In the text (which must be a separate line) you put a # character followed by the .BMP file name where the picture is to appear.

If you want to insert an image stored in an .LGW file, you have to type $ on the separate line followed by the name of the LGW file. Optionally, this name can be followed by three numbers (separated by commas). If present, these numbers specify:

  the first frame of the image to be displayed (1 means the first one),

  the number of frames to be displayed, and

  the number of pixels left blank on the screen to separate the frames.


  Command Line Editing Keys

The command line starts with the text prompt (normally, it is a question mark). It prompts you to type in a Logo command or commands. These will be run immediately after you press the Enter key. The way the contents of the command line is executed depends on the actual Logo mode: it may be

  another line of your procedure definition, if Logo is in a procedure definition mode,

  a complete Logo instruction, like RIGHT 90, which is run at once,

  several complete instructions, like FORWARD 100 RIGHT 90, which are run at once, one by one from left to the right,

  only the name of a command (that is, a command which normally expects one or more inputs, like SETPENCOLOUR, but you pressed Enter or F9 without specifying it / them). If a chooser exists for this particular command, it opens on the screen and waits for the input / inputs,

   text (a character, a word, or a list) expected by READCHAR, READWORD, or READLIST.

Any part of a command line can be selected in the standard Windows way and cut or copied into the Clipboard. If there is currently any text in the Clipboard (that is, any text which you have previously Cut or Copied either here or elsewhere), it can be pasted into the command line at the current cursor position by pressing Ctrl+V keys.

Before you press the Enter key, the contents of the command line can be edited in the standard Windows way. Beside this, there are some additional important keyboard shortcuts:

  Up arrow displays the previous contents of the command line (from the History of Command Line's Contents). If you keep pressing the key, older and older commands are displayed - 10 or even more previous commands can be found and used again in this way,

  Down arrow goes in the opposite direction in the History list; if you have already pressed the Up arrow once or more, you move to the more recent instructions,

  Esc erases the whole command line and moves the cursor to the beginning.


Right Mouse Button in the Text Screen
  Right Mouse Button in the Text Screen;   Alt+F9

To learn more about any command, click on it in the picture  with the mouse.

Opens the Inputs Menu from which you can select one of several standard SuperLogo choosers. However, there is an important difference between opening a chooser through pressing Enter or F9 and opening the Inputs Menu by clicking the right mouse button inside the text screen:
while Enter or F9 helps you to set correct inputs for a Logo primitive procedure (with a chooser), the Inputs Menu helps to set correct inputs to any primitive or user-defined procedure or to create data.
Two examples:
1. You can type the name of our own procedure PLAY.TWICE then through the Inputs Menu open the Play Wave Chooser, set the name of a .WAV file there and close it by pressing the Write it! button. At the cursor position you get the name of the file together with its path,
2. You can type into the command line MAKE ROUTE (LIST  then from Inputs Menu select the Co-ordinates [X Y] option. The Co-ordinates Chooser opens and you set a point by clicking in the graphics screen. The corresponding point in the form [X Y] is typed by Logo at the end of the command line. You can repeat these steps several times, getting a list of points.

  Shortcut Keys:  Alt+F9


Right Mouse Button in the Text Editors
  Right Mouse Button in the Text Editors;   Alt+F9

To learn more about any command, click on it in the picture with the mouse.

Opens the Inputs Menu from which you can select one of several standard SuperLogo choosers. However, there is an important difference between opening a chooser through pressing F9 and opening the Inputs Menu by clicking the right mouse button inside the Object Editor or File Editor:

while F9 helps you to set the correct inputs for a Logo primitive procedure (with a chooser), the Inputs Menu helps to set correct inputs to any primitive or user-defined procedure. For example, you can type the name of our own procedure PLAY.TWICE then through the Inputs Menu open Play Wave Chooser, specify the name of a .WAV file there and close it by pressing the Write it! button. At the cursor position you get the name of the file together with its path.

  Shortcut Keys:  Alt+F9


  Change Turtle Dialogue

To learn more about the dialogue, click on its parts with the mouse.

Opens the Change Turtle Dialogue. Here you can modify some - but not all - of the settings of the turtle for which you opened it.


Name ...

in the text box here you see the turtle's name. However, you cannot modify it, because the turtle already exists. To rename the turtle, you must first erase it with ERASETURTLE and then create it with a new name.


Xcor, Ycor ...

are two numbers, X and Y, setting the position of the turtle. If you close the Change Turtle Dialogue with the Do it! button, these two numbers become the turtles new home position.


Set Heading Button ...

opens the Turn Chooser, in which you can see the heading of the turtle. If you close the Change Turtle Dialogue with the  Do it! button, this number becomes the turtles basic heading.


Do it! Button ...

confirms all settings in the dialogue window and closes it.


Write it! Button ...

is always disabled in this dialogue box, because the window was opened with the right mouse button through the Shortcuts Menu.


Four Check Boxes ...

Here you can see or modify the following settings:

Pen Down check box: the pen can be up or down. The state of the check box shows the state of the turtle's pen and can be changed,

Show Turtle check box: the turtle can be shown or hidden. The state of the check box shows the state of the turtle and can be changed here,

Make Active check box: if the turtle is active, this check box is disabled and cannot be changed. Otherwise, an inactive turtle can be made active from here,

Set Frame Mode check box: if not checked, the turtle is using standard method for displaying its heading through the corresponding frame. Otherwise, it is an animated turtle, see SETFRAMEMODE. It can be modified from here.


  Other Keys and Their Effects

Beside command line editing keys and function keys F1 to F12 you can also make use of the following shortcut keys:

  Ctrl+F1 - if the text cursor is currently positioned within any Logo primitive procedure name (and the Main Window is active), Ctrl+F1 opens Help with the detailed information about this procedure, (this is not true while a program is running),

  grey plus ( + ) key (to the right from the numeric keypad) - shows all active turtles in the graphics screen. It is the same as typing in SHOWTURTLE. This shortcut can be used any time, even while a procedure is running,

  grey minus ( - ) key (to the right from the numeric keypad) - hides all active turtles from the graphics screen. It is the same as typing in HIDETURTLE. This shortcut can be used any time, even while a procedure is running. When turtles are hidden, all drawings are done much more quickly,

  Shift+grey plus ( + ) keys - shows all turtles (active and inactive) in the graphics screen. This shortcut can be used any time, even while a procedure is running,

  Shift+grey minus ( - ) keys - hides all turtles from the graphics screen. This shortcut can be used any time, even while a procedure is running,

  Ctrl+Break stops any running instructions. It is the same as pressing F12 function key or clicking the Stop button with the left mouse button (however, there is a difference if you set FKEYS to 12 with SETLOGO),

  Ctrl+F9 runs the STARTUP procedure, if it currently exists in the Memory. Can be used to restart your project (present in the memory) after having been stopped with Ctrl+Break or F12 or the Stop button, or to start a project for the first time, if it has been opened without the Run STARTUP option. It is the same as typing in a STARTUP command in the command line of the text screen. (Ctrl+F9 is not functional while a program is running),

  Alt+F9 - opens the Inputs Menu (this is possible while a program is running),

  Ctrl+K - opens the History Window containing all recent contents of the command line.


  Resizing and Scrolling the Graphics Screen

When SuperLogo starts, the actual height and the width of the graphics screen are set by the maximised size of the Main Window. However, it may be resized later separately from the Main Window's size or the size of the text screen (i.e., the number of lines actually displayed). To resize the Main Window, SETLOGOSIZE can be also used. The size of the Main Window will control how much of the whole graphics screen is visible at any time.

To change the size of the graphics screen, you can use SETGS, or select Set Screen... in the Options Menu. In the Set Screens dialogue box you can also set if it should have scroll bars (in case the graphics screen is larger than its currently visible part), and if it should be centred in the Main Window. Beside this, the graphics screen can also be resized by loading a bitmap with LOADSCREEN which (if it has only one input) sets the size of the screen to be the width and height of the bitmap.

Scrolling the screen may be done either with the scroll bars or with the following shortcut:

  hold down the Ctrl key, press the right mouse button anywhere in the graphics screen and drag it in the direction you need. This shortcut is useful when you don't want to have scroll bars displayed around the graphics screen.

See also:

  Left Mouse Button

  Right Mouse Button


  Speed Bar Buttons

To learn more about any button, click on  it in the picture with your mouse

The Speed Bar is displayed across the top of the Main Window to give you quick access to several commands and options which would be otherwise reached through two or even three menu commands. Its buttons can be clicked with the left mouse button (whenever they are not greyed), or by pressing F1 for the first of them, F2 for the second of them etc., see Function Keys F1 to F12. The Speed Bar can be hidden/shown either with Hide / Show Speed Bar in the Window Menu or with HIDESPEEDBAR and SHOWSPEEDBAR.

The twelve buttons of the Speed Bar are divided into three groups of four buttons with a small space between groups.


  Function Keys F1 to F12

F1 - SuperLogo Help

F2 - Save Project As...

F3 - Open Project...

F4 - Show / Hide Memory

F5 - Graphics Screen

F6 - Split Screen

F7 - Text Screen

F8 - Choose a Problem...

F9 - Show List of Commands Window or  Show Chooser

F10 - Show / Hide Buttons Window

F11 - Choose a Demo Program

F12 - STOP the running procedure


  F12 Function Key

Is used to stop a running program (project, calculation etc.).

If you press function key F12, Logo stops the instruction and gives error number 25 with the text STOP. Therefore, pressing F12 can be used by a Logo program through CATCH "ERROR [ ... ]. However, you cannot stop a running program with F12, if FKEYS is set to 12 with SETLOGO. The only option then is to use the Ctrl+Break keys.

  Speed Bar Button:

  Function Key:  F12


  Left Mouse Button

With the left mouse button (either by clicking, double-clicking, or dragging) you can do the following in the Main Screen:

  open its Control Menu by clicking the Control Menu button,

  close the application by double-clicking the Control Menu button,

  restore or maximise the Main Window by double-clicking in the title bar,

  minimise or maximise the Main Window by clicking the minimise or maximise buttons,

  select a command from the menu bar,

  press any Speed Bar button (which is equivalent to pressing F1 to F12),

  when the mouse pointer is correctly positioned over the dividing line between the graphics screen and the text screen, it changes its shape to show that a vertical adjustment of the division can be made. In this way you can set how many lines will be displayed in the text screen and what part of the graphics screen will be visible.

See also:

  Right Mouse Button

  Right Mouse Button in the Text Screen


  Right Mouse Button

With the right mouse button (either by clicking, double-clicking, or dragging) you can do the following in the Main Window:

  move any shown turtle to any position in the graphics screen, if you hold down the Shift key and drag the turtle with the right mouse button,
  scroll the graphics screen, if you hold down the Ctrl key and drag the screen with the right mouse button,
  open the Inputs Menu, if you click inside the text screen,
  open a Shortcuts Menu (on the left) by clicking in the graphics screen on any shown turtle, either active or not. (By clicking on a turtle we mean clicking on any point inside its current shape. If there are overlapping turtles in one place, the youngest of them is chosen.) In this menu you can select any command with the left mouse button, or with arrow keys, or by pressing the underlined character,

  open a version of the Shortcuts Menu (on the left) by clicking in the graphics screen at the position where no turtle is shown (that is, either there is actually no turtle at the position, or the turtle is currently hidden).

See also:

  Left Mouse Button
  Right Mouse Button in the Text Screen


Move Turtle ...

The mouse cursor changes to a cross + question mark. With this cursor you can drag (either with the left or right mouse button) any shown turtle (active or inactive) to any location within the graphics screen. If the turtles pen is down, a line connecting the previous and new positions will be drawn on the screen.

  Alternative:   press the Shift key and drag the turtle with the right mouse button


Copy Screen ...

copies the contents of the graphics screen, i.e. without the shapes of shown turtles, onto the Windows Clipboard. From there it can be pasted back into SuperLogo or into any other Windows application able to use bitmaps.


Paste Screen

loads the contents of the Windows Clipboard into the graphics screen. If the contents of the Clipboard is not a bitmap, the Paste Screen command is disabled. The current width and height of the graphics screen is set to the size of the loaded bitmap. If its size is smaller than the standard settings of Logo's Main Window, the loaded bitmap is placed either at the upper left corner of the screen or is centred in the Main Window according to the current SETGS settings.


Turtle: Pen Up / Pen Down

If the pen mode of the turtle is down, the command is Turtle: Pen Up and vice versa. Here you can change the setting by turning the check box on or off.


  Control Menu

This menu contains commands that allow you to move, resize or close the application window and is very useful when you are not using the mouse.

  Restore	restores the application window to its original size,

  Move	lets you move the window using keyboard arrows,

  Size	lets you resize the window using keyboard arrows,

  Minimise	reduces the application to an icon,

  Maximise	enlarges the application to full screen,

  Close	closes and quits the application,

  Switch to...	switches to the Task Manager's list of running applications.

Restore, Move, Size, Minimise, and Maximise can be used by clicking or double-clicking with the mouse. To access the Control Menu, you can also press Alt+Space bar.


  Parts of the Main Window

The SuperLogo Main Window is an ordinary Windows application window with all the usual features: its border, Control Menu icon at the left end of the title bar, minimise and maximise (or restore) buttons at the right end of the title bar, menu bar with its commands, Speed Bar with twelve large buttons to perform some tasks faster (either by clicking a button with the  mouse or pressing the corresponding function key), and finally - the largest part called the working area, which is divided horizontally into two parts (panes):

  Text Screen

  Graphics Screen

A horizontal bar which splits the working area into two screens can be dragged with the mouse or moved with Set Screen... in the Options Menu. However the bar itself doesn't define the sizes of the screens, it only defines how much of them will be visible.

  Resizing and Scrolling the Graphics Screen


I belong to ...

  On Main Window


  File Menu Commands (in the Main Window)

To learn more about any command, click on it in the picture with  your mouse.

  Menu Bar

  File Menu Commands

If you select the File menu in the Main Window, a menu is displayed containing commands which work with Logo projects, which allow you to define directory paths for work directory, demo projects, and problems, which make it possible to print different parts of your work and finally - to quit the application.


  Edit Menu Commands (in the Main Window)

To learn more about any command, click on it in the picture with  your mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

Commands in this menu are for using the Clipboard for cutting, copying, and pasting text into and from the command line.


  Window Menu Commands (in the Main Window)

To learn more about any command, click on it in the picture with  your mouse

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Window Menu Commands

If you select the Window menu in the Main Window, a menu is displayed containing commands which help you organise and customise the window, to divide it into graphics screen and/or text screen, to clear part of or the whole screen etc.


  Options Menu Commands (in the Main Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Window Menu Commands

  Options Menu Commands

You use commands in this menu to set the sizes of both the  graphics screen and text screen and to customise your work by setting the language version, the way the error messages will be displayed etc.


  Help Menu Commands (in the Main Window)

To learn more about any command, click on it in the picture with the mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Window Menu Commands

  Options Menu Commands

  Help Menu Commands

If you select the Help menu in the Main Window, a menu is displayed containing commands which should help you to learn all the technical details about Logo and about all its primitive procedures.


About SuperLogo Main Window...

opens an About dialogue listing the authors and the publisher of SuperLogo.


  New Project

Brings up a warning box with Do you want to erase everything in the Memory? If you choose Yes, Logo erases all memory objects and all turtles, runs a new SLOGO.INI file - if it exists in the home directory. It also clears the graphics screen and resets  SuperLogo (and its Main Window by running the instruction SETLOGOSIZE [ ] ) as if it were closed and started again.

After erasing all memory objects, all SuperLogo settings are changed to their basic values.

  Logo Language:  ERALL


I belong to ...

  On File Menu in the Main Window


Open Project...
  Open Project...;   F3, Shift+F3

To learn more about this dialogue, click on it with the mouse.

Is used to open an existing project. The Open Project dialogue box appears on the screen. It consists of several list boxes, buttons, and check boxes to set up the project.

  Speed Bar Button:

  Function Key:  F3 or Shift+F3, if you do not want to run the project's STARTUP procedure

  Colour Transformations in Loading and Saving Graphics


Project Name ...

Here you select or type the name of the file you want to open. This box lists all files with the filename extension selected in the List Files Of Type box and stored in the currently selected Directory. To see a list of files with other extension, for example, Logo libraries with .LLB or .LBS extensions, you can type *.LLB or *.LBS into Project Name box.


List Files of Type

Lists Logo Project Files (*.LGP) and Logo Program Files (*.LGO).


Options for Open Project (in Main Window)
  Options for Open Project

To learn more about this dialogue, click on it with the mouse.

Displays the Options for Open Project dialogue box in which you specify which objects stored in the project you want to open and how you want SuperLogo to use them.


Complete Project / Only Parts ...

If the Complete Project box is checked, all parts of the project will be loaded. In this case, all 5 check boxes listed bellow are automatically checked as well. However, you can specify just some parts of the project to be loaded:

  Screen - the contents of the screen will be loaded,

  Procedures - user-defined procedures will be loaded,

  Variables - user-defined variables will be loaded,

  Properties - words with defined properties will be loaded,

  Turtles - all turtles in the project will be loaded.

If you turn any of these boxes off, the Complete Project box is automatically turned off as well.


Bury Them ...

all objects will be buried immediately after they are loaded, see BURY, unless you turn this option off.


Add to Memory (no erase) ...

normally all user-defined objects are erased from the Memory before another project is opened. However, if you check the Add to Memory option, no objects present in the Memory are deleted and all new objects are added to them.


Run STARTUP ...

If the selected project contains a procedure named STARTUP, it will automatically be run after the whole project is loaded into the Memory. Thus the project can be started with Logo commands from the STARTUP procedure as soon as it is opened - unless you check this option off.


Ignore Errors ...

If an error occurs during the Open Project process in any of the selected parts due to some damage in the file data, Logo tries to skip this part and load as many correct components as possible.


I belong to ...

  On Open Project Command in the Main Window


I belong to ...

  On Save Project As ... Command in the Main Window


Info Window in Open Project / Save Project As
    Info Window

To learn more about this dialogue, click on it with the mouse.

In this window you can either include (if you are saving a project) or look at (if you are opening it) important information about the .LGP project file itself:

Title: the title either set in the Options for Save Project Window, or generated by SuperLogo if you did not specified any.
Name of the File
Size, Date and Time: when opening the project, you are informed of the size of the file, and the date and time it was saved.
Info Text: a short note (up to 250 characters) can be typed inside this box when you are saving the project.


Save Project
  Save Project;   Shift+F2

If your project has already been saved with Save Project As..., its Name or its Title appears in the title bar of the Main Window. If you select Save Project command now, the current state of the project is saved - with the same options as set in the previous Save Project As... process.

When you save a project for the first time, Logo automatically displays the Save Project As... dialogue. If you want to save the same project with a different Name, Title, or any other possible options, you have to select Save Project As... yourself.

  Colour Transformations in Loading and Saving Graphics

  Function Keys:  Shift+F2

  Logo Language:  SAVE (for .LGO type of file)


Options for Save Project As (in Main Window)
  Options for Save Project As

To learn more about this dialogue, click on it with the mouse.

Displays the Options for Save Project dialogue box where you choose which objects will be saved in the project (this option allows you to create libraries or incomplete projects).


Complete Project ...

If this check box is selected, all parts of the project will be saved. The Complete Project option, however, doesn't automatically save buried objects unless you check the Save also Buried Objects option. If you decide not to save any part of the project, the Complete Project check box is automatically turned off.

Screen - sets whether or not the current contents of the graphics screen will be saved with the project,

Procedures - to save user-defined procedures,

Variables - to save variables,

Properties - to save words with defined properties.

Turtles - to save all turtles in the project.


Save also Buried Objects ...

This check box must be selected if you want to save all user-defined objects which are currently buried with BURY.


Create .ICO File ...

This check box is available only if there is an image variable named ICON currently present in the Memory Window.

If this option is checked, a file with the .ICO extension and with the same name as the project being currently saved will be created in the same directory. However, the ICON variable must be an image whose first frame is exactly 32 x 32 in size.


Add as Windows Application
  Add as Windows Application ...

To learn more about this dialogue, click on it with the mouse.

The check box can only be selected if there is a STARTUP procedure present in the Memory.

If checked, the project being saved will be installed in the SuperLogo group window (or other window, see below) as a stand-alone application. Its icon will be either the ICON image variable (if Create .ICO File option is also checked) or standard turtle icon, if there isn't such a variable. The title of the project will become the title of the application, which will only work if the SuperLogo engine is present.

If you then start this stand-alone application, a Run Time SuperLogo Version runs the project as a normal program. It can be stopped by pressing the Stop! command in its menu bar. After closing the Options for Save project As dialogue and pressing the OK Button in Save Project As dialogue, Add As Windows Application dialogue opens.


Icon of a Project ...

shows the icon of the project to be saved as a Windows Application together with the text which will appear below the icon (called the  Description). This text is specified in the Title box of the Options for Save project As dialogue. If no text is specified there, the Description below the icon will be the name of the project.


Project Name: ...

shows the name of the project to be saved as a Windows Application.


Adding Project to the Group: ...

is a combination box. If you click the [image] icon to the right of it, you get a box with a list of all Program Manager groups. You can choose a group here. Or you can type the name of a group in the edit box.


Title ...

If you do not set a title for the project, its Name will appear beside "SuperLogo" in the title bar of the Main Window. If you type any title for the project in the Title box, it will be placed in the title bar.


Program Name ...

Here you can type any word of up to 9 characters. If this project is placed into the DEMO sub directory  later, i.e. if it is used as a demo project, the Program Name will appear below the project's icon in the Demo Projects dialogue box instead of the file name.


Save Project As...
  Save Project As...;   F2

To learn more about this dialogue, click on it with the mouse.

Is used to save and name your project. The boxes in the Save Project As dialogue box make it possible to set all details necessary. To save a project which has already been saved and now is only being changed, use Save Project.

  Speed Bar Button:

  Function Key:  F2

  Logo Language:  SAVE (for .LGO type of file)

  Colour Transformations in Loading and Saving Graphics


Project Name ...

Here you set the filename to save a project (either as a .LGP or .LGO file) with a new or different name. You can either type the name in the Project Name text box, or use the current name, or select a name in the list of projects box.


Directories and Drives

Here you select the directory and drive where you want to store your Logo project. The directory displayed first is the work directory currently set by SETPATH or by Set Path... in the File menu.


Save File as Type: ...

SuperLogo can save projects in two different formats: either as a .LGP Logo project file or as a plain .LGO text file.


  Set Path...

To learn more about this dialogue, click on it with the mouse.

This command makes it possible to set and see the current work directory. It opens the Set Path dialogue box with the following options:

  Logo Command:  SETPATH

  Corresponding Logo Operation:  PATH


List of Files ...

This list box is present in the dialogue to show you which files are stored in currently selected directory. Nothing can be selected or changed here.


Actual Path ...

This line can't be edited, it only shows the currently selected work directory. To modify it, choose a drive and a directory in the boxes to the right, then press the OK button or Enter key.


Choose a Demo Program...
  Choose a Demo Program...;   F11

To learn more about this dialogue, click on it with the mouse.

Opens a Demo Projects dialogue box, which allows you to choose any demo project stored in the DEMO sub directory. If there are no projects stored in this subdirectory, a message appears on the screen saying: I Have No Demo Projects Defined. Demo projects always start to run immediately after they are opened.

  Speed Bar Button:

  Function Key:  F11


Demo Projects' Icons ...

is a chooser of all demo projects stored in the DEMO sub directory. Here you can start a project either by double clicking its icon, or simply by selecting it and pressing the Enter key or OK Button.

In some cases - if there are too many icons in the window, a horizontal scroll bar appears at the bottom of the region.


Choose a Problem...
  Choose a Problem...;   F8

To learn more about this dialogue, click on it with the mouse.

Opens the Problems dialogue box which lists titles of all problems stored in PROBLEM sub directory of SuperLogo. If there are no problems stored in this sub directory, a message appears on the screen saying: I Have No Problems Defined. After choosing a Problem from the list, a window with its text appears on the screen and remains there until it is closed.

  How to Produce Text for Your Own Problem

  Speed Bar Button:

  Function Key:  F8


Names of Problems ...

Here all Titles of  Problems are listed, so that you can choose any of them and open a Window with a problem's contents itself.

  How Problems and their Titles Are Produced


Run Startup
  Run Startup;   Ctrl+F9

Runs STARTUP user-defined procedure if this Logo procedure is currently present in the Memory. Run STARTUP is used for starting or restarting projects while you develop, test or use them.

  Shortcut Keys:  Ctrl+F9

  Is the same as typing STARTUP directly in the command line.


  Load Screen...

To learn more about this dialogue, click on it with the mouse.

Use this for loading new contents to the graphics screen which have been saved in a .BMP file or .LGP project file. The Load Screen... dialogue box opens. After choosing a file, the current width and height of the graphics screen is set to the bitmaps size, see LOADSCREEN.

  See Also Details on Load Screen Chooser.


Dialogue Control Menu ...

is a reduced standard control menu. It contains only two commands:

  Move

  Close     Alt+F4


  Save Screen As...

To learn more about this dialogue, click on it with the mouse.

Use this for saving the current contents of the graphics screen in a .BMP file or .LGP file. The Save Screen As dialogue box opens:

To find more details on saving the contents of the graphics screen, see SAVESCREEN.


  Print Graphics Screen

To learn more about this dialogue, click on it with the mouse.

Prints the current contents of the graphics screen. Opens the Print Graphics Screen dialogue box in which you see and/or choose following settings:

  Logo Language:  PRINTGRAPHICS


Printer ...

specifies the default printer set in the Printers/Control Panel Windows application.


With Turtles ...

If this option is checked, the shapes of all currently shown turtles will be printed together with the contents of the graphics screen.


Resolution ...

There may be several levels (300 dpi, 150 dpi etc. depending on our printer) of printing quality listed here in the drop-down list box. You can choose any of them.


Copies ...

In the text box you specify the number of copies. Normally, it is set to 1.


Collate Copies ...

Organises pages when you print multiple copies. If the option is turned on, SuperLogo prints a complete copy of the screen (it may take more sheets of paper depending on the size) before it begins to print the first page of the second copy.


Print to File ...

will print the contents of the graphics screen to a file. The Print Manager will prompt you to enter a name for the file.


  Margins

To learn more about this dialogue, click on it with the mouse.

Opens the Margins dialogue box. Here you set the Left, Right, Top, and Bottom margins of a paper on which the printing is going to be done. Use this option when printing the contents of the graphics screen, text screen, or any objects from the Memory Window.

You can also choose the Measurement Units here (centimetres or inches).


  Print Text Screen

To learn more about this dialogue, click on it with the mouse.

Prints the current contents of the text screen. Opens the Print Text Screen dialogue box in which you see and/or choose the following settings:

  Logo Language:  PRINTTEXT


Print Memory
  Print Memory...

This command makes it possible to print the definitions of the user-defined objects stored in the Memory Window. It opens the Print Objects from the Memory Window dialogue box in which you see and/or choose the following settings:

It is the same as Print Objects... in the File Menu in the Memory Window, if you choose the All Objects option in that dialogue. Print Memory is disabled whenever there are no memory objects.

  Logo Language:  PRINTMEMORY


Range ...

Here you can choose to print procedures, variables and properties. However, each of these selections means that all procedures, all variables and/or all properties will be printed.


Which Objects ...

The All Objects option is fixed here. To print only selected objects, you have to open the same dialogue box, but from the Memory Window by choosing the Print Objects... command there.


Titles and Icons

Here you can choose whether each memory object should be accompanied by its Icon and Title - similar to the one displayed in the List of Objects in the Memory Window.


Print Setup
  Printer Setup...

Opens the standard Windows Print Setup dialogue box in which you set:

  Printer - whether a Default Printer or a Specific Printer is active,

  Orientation of the paper (Portrait or Landscape),

  Paper - its Size and its Source on the printer,

  Options  - sets Dithering, that is, the way graphics will be printed, Intensity Control, that is, the darkness and fineness of graphics and text, and Print True Type as Graphics options.


Exit Logo
  Exit SuperLogo;   Alt+F4

Is used to close your Logo session. Logo prompts you to save your work before ending the application.

  Shortcut Keys:  Alt+F4, Alt+X

  Logo Language:  BYE

  Mouse Shortcut:  Double-click Control Menu icon


I belong to ...

  On Window Menu in the Main Window


Graphics Screen
  Graphics Screen;   F5

Sets the entire Main Window to graphics screen.

Text screen is not displayed, although its contents are not lost. The text screen is still active, that is, Logo accepts instructions typed in from the keyboard - and runs them immediately. If you reset the Main Window to display the text screen only with Text Screen in the Window Menu, or with TEXTSCREEN, it will contain the most recent contents. The same is true if you set the window to display both screens with SPLITSCREEN.

  Speed Bar Button:

  Function Key:  F5

  Logo Language:  GRAPHICSCREEN;  GS


Split Screen
  Split Screen;   F6

Sets the Main Window to both graphics screen and text screens.

The current contents of both screens are not affected by this command, see SPLITSCREEN, GRAPHICSCREEN, and TEXTSCREEN. Split Screen doesn't change the size of the graphics screen, it only affects the size of the part you can see. Even if the graphics screen can't be displayed completely it is still working, that is, turtles can live and move even outside the part you can see.

  Sizing and Scrolling Graphics Screen

The number of lines displayed in the text screen can be set either with Set Screens... in the Options Menu or SETTS.

  Speed Bar Button:

  Function Key:  F6

  Logo Language:  SPLITSCREEN;  SS


Text Screen
  Text Screen;   F7

Sets the entire Main Window to text screen.

The text screen now covers the working area of the Main Window completely. the Graphics screen is shown, but its contents is not lost. It is still working - all active turtles can continue drawing there. If you later choose Graphics Screen or Split Screen, its most recent contents will be displayed.

  Speed Bar Button:

  Function Key:  F7

  Logo Language:  TEXTSCREEN;  TS


  Clear Graphics

Clears the contents of the graphics screen by filling it completely with the currently set background colour. When Logo is started, the background colour is always white. To change it, use SETBACKGROUND.

When clearing the graphics screen, each active turtle is moved (without drawing a line) to its home position and basic heading, see MAKETURTLE.

  Logo Language:  CLEARSCREEN;  CS


  Clear Text

Clears the text screen by filling it completely with currently set text screen background colour (it is normally white, to change it use SETTC). Then it prints the prompt, which is normally ?, but can be redefined with SETPROMPT.

  Logo Language:  CLEARTEXT;  CT


  Clear Both

Clears both graphics screen and text screen. The graphics screen is filled completely with the set background colour, which is defined by SETBACKGROUND. The text screen is filled completely with the set text screen background colour (it is normally white, to change it, use SETTC).

Clear Both is equivalent to the using Clear Graphics and Clear Text in the Window Menu.


Show / Hide Memory
  Show / Hide Memory;   F4

Opens (if it is currently closed) or closes (if it is currently open) the Memory Window. In it you can view, create, modify, or debug user-defined memory objects.

  Speed Bar Button:

  Function and Shortcut Keys:  F4 or Ctrl+F4 or Alt+F4 if Memory Window is currently active


  Hide / Show Speed Bar

Displays (if it is currently hidden) or hides (if it is currently displayed) the Speed Bar. All function keys are still active, even if the Speed Bar is hidden. For example, you can press F5 to set the entire Main Window to graphics screen even if the Speed Bar button is not displayed.

This command doesn't change the actual size of the graphics screen, it only affects the size of the part you can see. When the Speed Bar is hidden, the graphics screen can be made a little bit larger, see either Set Screens... or SETGS. If the Speed Bar is hidden and you set the size of the graphics screen to cover the working area of the Main Window, bringing  the Speed Bar back will hide some of it. However, even if the graphics screen can't be shown completely, it is still working, that is, the turtles can live and move outside the visible part.

  Sizing and Scrolling Graphics Screen


Next Window
  Next Window;   Ctrl+F6

Sometimes you have more than one window open in SuperLogo, for example, Memory Window, one or even more windows with problems to be solved, File Editor Window etc. The Next Window command switches from one to the other - in this way it helps to organise all windows in the Logo Main Window.

If the Memory Window is currently shown (together with other windows), it is always the first one to be switched to after selecting Next Window.

  Shortcut Keys:  Ctrl+F6


  Cascade

If several  SuperLogo windows are open at the same time (for example, Memory Window, one or even more windows with texts of problems to be solved, File Editor Window etc.) you may need to arrange them so that none of them is completely covered by another.

Cascade arranges all windows within the Main Window so that they overlap (starting near the upper-left corner of the Main Window's working area) and the title bar of each window can be seen. Cascading windows covers neither title bar, nor the menu bar, nor the Speed Bar - if it is shown - of the Main Window.

Besides rearranging all windows, Logo may also re size them to their "basic" size, that is, the original size of the window when it was opened.


  Set Screens ...

To learn more about this dialogue, click on it with the mouse

This opens the Set Screens dialogue box in which you set the sizes and other features of both the graphics screen and text screen.

If the number of lines displayed in the text screen is changed, the actual size of the graphics screen is not changed, only the size of the part you can see is affected. If all the graphics screen can't be displayed, it is still working, that is, turtles can live and move even outside the visible part.

When the size of the graphics screen is changed, it is filled with the set background colour. When Logo is started, the background colour is always white. To change it, use SETBACKGROUND.


Graphics Region ...

in which you specify:

  Width - a number of pixels between 8 and 2048,

  Height - a number of pixels between 8 and 2048,

  Centred - is the graphics screen centred in the Main Window? Normally this option is checked,

  Has Scroll Bars - are the scroll bars displayed or not? Normally this option is not checked.

To learn more, see SETGS.


Text Region ...

in which you specify:

  number of Visible Lines - a number between 1 and N (depends on your hardware, usually it is 24 to 32),

  Prompt - normally it is ? but can be redefined  with SETPROMPT


OK Button ...

confirms all settings in the dialogue window and closes it.


Cancel Button ...

cancels all changes you have made in the dialogue window, closes it and restores the previous settings.


Default button ...

should be pressed to return all settings to their original values.

  Logo Language:  SETGS, SETTS

  Special Shortcut:  to specify the number of lines of the text screen, drag the border which separates both screens


I belong to ...

  On Options Menu in the Main Window


  Errors to Pop-Up Window

Is initially turned on. If an error occurs, a pop-up Error Window opens with one or two sentences describing and explaining the error.

  List of Error Messages

If you turn off the command, all error messages are printed only in the text screen. In this case the message is always shorter and consists of only one sentence.

  Logo Language:  SETLOGO with ERROR key word


  Help for Kids

Is normally turned off. In this case the standard Windows Help application will use SLOGO.HLP file to display help topics.

If you select the command (i.e. when the option is turned on), another help file is used to explain topics - if it exists, namely SLOGO0.HLP file.

  Logo Language:  SETLOGO with HELP key word


  National Version

Turns on and off the option to communicate with Logo in an alternative national language. When this option is turned on, you can use both:

  standard English names for all Logo basic procedures, or

  their native equivalents, which is more natural especially for younger users.

Thus you can type in any of the following instructions:

? FORWARD 50

? FD  50

? VOORUIT 50	; in Dutch version

? VT  50	; in Dutch version

When the option is turned off, Logo understands only standard English names for basic procedures.

  Logo Language:  SETLOGO with VERSION key word


  Auto SetPath

This option is normally turned off, which means that loading a project or loading an image doesn't modify the path. If it is selected, however, each Open Project updates the work directory and each LOADIMAGE operation updates the image path. To change this setting from a program, use SETPATH with the "IMAGE as its first input.

Updating the path means that the next Open Project command or LOADIMAGE operation will use the same path as set the last time.

  Logo Language:  SETLOGO with AUTOPATH


  Stepping

To learn more about the dialogue, click on it with the mouse

This option is normally turned off. If it is selected, the stepping mode is turned on. In this case, whenever Logo is to use any of the commands FORWARD, BACK, LEFT or RIGHT, it stops and opens the I am Going To Do Window. Thus, stepping mode is a simplified and elementary turtle geometry oriented variation of the more sophisticated debugging.

  Logo Language:  SETLOGO with STEPPING key word


Logo Instruction ...

consisting of FORWARD, BACK, RIGHT or LEFT commands which will be used in the next instruction. They are displayed here together with their input.


OK Button ...

when pressed, runs the instruction printed above in the I am Going To Do Window. The instructions then goes on until another FORWARD, BACK, RIGHT or LEFT instruction is found.


Go Button ...

turns the stepping mode off, closes the I am Going To Do Window and completes the instructions without stopping.


Stop Button ...

turns the stepping mode off, stops the running instruction, closes the I am Going To Do Window and opens an error message saying: Calculation Stopped in Line ... of Procedure ...


  Highlight Primitives

Is normally turned on, which means that all Logo language procedures' names and all words with special meanings will be highlighted in a different colour when typed in or displayed either in the Object Editor or in the File Editor.

If you turn this option off, no words will be highlighted unless you turn the option on in a particular Object Editor Window or File Editor Window. That means that the Highlight Primitives setting in the Main Window is global for the whole SuperLogo but may be overwritten in any particular editor window.

  Logo Language:  SETLOGO with HIGHLIGHT key word


  Indent in Editors

Is normally turned on, which means that when you press Enter either in the Object Editor or in the File Editor, Logo automatically indents the following empty line so that it starts at the same column as the previous line.

If you turn this option off, no spaces are inserted at the beginning of a new line after pressing Enter, that is, the text cursor is placed in the first column, unless you turn the option on in a particular Object Editor Window or File Editor Window. That means that the Indent in Editors setting in the Main Window is global for the whole of SuperLogo but may be overwritten in any particular editor window.

  Logo Language:  SETLOGO with INDENT


Cut (in the Main Window)
  Cut;   Ctrl+X

This command allows us to remove any selected text from the text screen command line and put it onto the Windows Clipboard. This text can later be put back into the command line or in any new location in the File Editor, in the Object Editor or even outside SuperLogo by choosing the Paste command.

The text currently on the Clipboard will be kept there until you cut or copy again.

The command is unavailable if you have no text selected.

Shortcut Keys: Ctrl+X


I belong to ...

  On Edit Menu in the Main Window


Copy (in the Main Window)
  Copy;   Ctrl+C

This command allows you to copy any selected text from the text screen command line and put it onto the Windows Clipboard. This text can be put back into the command line later or in any new location in the File Editor, in the Object Editor or even outside SuperLogo by choosing the Paste command.

The text currently on the Clipboard will be kept there until you cut or copy again.

The command is unavailable if you have no text selected.

Shortcut Keys: Ctrl+C


Paste (in the Main Window)
  Paste;   Ctrl+V

This command allows you to insert a copy of the text previously stored onto the Windows Clipboard at the position of the text cursor in the text screen command line. The Paste command is unavailable if the Clipboard is currently empty.

Shortcut Keys: Ctrl+V


How to Edit in the File Editor Window
  File Editor

The File Editor makes it possible to read, create, or change text files. It is a simple text editor for either:

processing Logo program files, that is, files with LGO extension,

processing Logo Problems files, that is, files with TXT extension,

editing Logo initial file SLOGO.INI.

If the contents of the Editor is a Logo program (the definitions of your own procedures, variables, and properties), or Logo commands with their inputs, it can be run from here. More File Editor Windows can be open and used at the same time (for copying and pasting parts of the text from one file to the other, etc.). In its title bar, each File Editor Window has either the name of the edited file, or Logo Editor - [untitled], if you choose File Menu New.

  The SuperLogo Environment

  File Editor

  How to Edit in the File Editor Window

To move through the File Editor Window, you use standard Windows Keyboard Shortcuts in the Editors. To move any text within the File Editor Window, you can use either Drag-and-Drop Editing or the Clipboard and its Cut, Copy and Paste commands.

  Menu Bar

  Right Mouse Button in the File Editor


I belong to ...

  On File Editor Window


  File Menu Commands (in the File Editor)

To find out more about any command, click on it in the picture with your mouse.

  Menu Bar

  File Menu Commands

Commands in this menu allow you to open or save any text file, to close the File Editor Window, or to switch to another SuperLogo window.


  Edit Menu Commands (in the File Editor)

To find out more about any command, click on it in the picture with your mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

Commands of this menu allow you to move texts within the File Editor Window with Drag-and-Drop Editing or (even outside this window) with the help of the Clipboard. To copy any text to the Clipboard, you must select it first. The contents of the Clipboard can then be pasted into a new location within the same file, into another file, in the Object Editor, or directly into the command line of the text screen.


  Search Menu Commands (in the File Editor)

To find out more about any command, click on it in the picture with your mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Search Menu Commands

You can use commands in this menu to search for and replace text in the File Editor Window.


  Options Menu Commands (in the File Editor)

To find out more about any command, click on it in the picture with your mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands


Highlight Primitives

If this option is selected, all Logo language procedures' names and all words with special meanings will be highlighted with a different colour when typed in or displayed in the Object Editor Window or File Editor Window. This option can also be set with Logo primitive command SETLOGO.


Indent

If this option is selected, any time you press Enter, Logo automatically indents the following empty line so that it starts in the same column as the previous one. This option can be set also with Logo primitive command SETLOGO.


  Execute Command (in the File Editor)

To find out more about any command, click on it in the picture with your mouse.

  Menu Bar

  File Menu Commands

  Edit Menu Commands

  Search Menu Commands

  Options Menu Commands

  Execute Menu Command

This command makes SuperLogo execute the contents of the File Editor Window - if there is currently no selection - or its currently selected part. The effect is the same as if you typed the text directly in the command line of the text screen.


New (in the File Editor)
  New

Clears the contents of the File Editor Window. Changes its title bar to

File Editor - [untitled]

If you made any changes to the original text displayed in the window and haven't saved it into a file yet, you are first asked to do so. You can save the previous contents of the window in this way and start creating a new file.


I belong to ...

  On File Menu in File Editor


Open... (in the File Editor)
  Open...;   F3

Is used to open an existing text file. Displays the Open File dialogue box in which you choose the name of the file to be opened. If the File Editor Window is currently not empty and its contents have been changed without being saved into a file, you are first asked to save it.

Open File dialogue box options:

File Name - here you type or select the name of the file you want to open. This box lists all files with the extension you select in the List Files of Type box. Initially it is .LGO extension. Listed files are files located in currently selected Directory,

List Files of Type - here you set the type of file you want to open. The drop-down list box contains the following options: Logo Program Files, Logo INI Files, Text Files,

Drives - here you pick the drive in which Logo stores the file that you want to open,

Directories - here you choose the directory in which Logo stores the file that you want to open. The directory displayed initially is the work directory (currently set by SETPATH or by Set Path... in the Main Window's File Menu).

Shortcut Key: F3


Save (in the File Editor)
  Save;   Shift+F2

Saves the active file currently displayed in the File Editor Window. When you save a file for the first time, the Save File As dialogue box opens so that you can name your file. If you want to change the file's name, location, or format before you save it, you must choose Save As....

Shortcut Key: F2


Save As... (in the File Editor)
  Save As...;   F2

Is used to save and name the file currently displayed in the File Editor Window with a chosen file extension. If you want to save the file with its existing name, format, and location, you should choose Save instead.

When Save As... is chosen, Logo displays the Save File As dialogue box with following options:

File Name - here you choose a filename to save a file with a new or different name or in a different file format. You can either type the name in the File Name text box, or use the current name, or select a name in the list of files box. If the file already exists, Logo prints a warning and asks you to confirm the choice,

Save File As Type - here you set the file format to be used. The drop-down list box contains the following options: Logo Program File, Logo INI File, and Text File,

Drives - here you choose the drive in which Logo will store the file that you want to save,

Directories - here you set the directory in which Logo will store the file that you want to save. The directory displayed initially is the work directory (currently set by SETPATH or by Set Path... in the Main Window's File Menu).


  Close Editor

Closes the File Editor Window.

Shortcut key: F4, Ctrl+F4, Alt+F4

Mouse Shortcut: Double-click the control menu icon of the File Editor Window


Undo  (in the Object Editor)
    Undo;   Ctrl+Z

You use this command to undo the last:

typing of a single character, or any longer piece of text, unless you moved the text cursor to another location,

deleting of single character, or any longer text, unless you moved the text cursor to another location,

if the operation is possible (which depends on the last action within the Editor).

Shortcut Key: Ctrl+Z


I belong to ...

  On Edit Menu in File Editor


Cut (in the Object Editor)
    Cut;   Ctrl+X

This command allows you to remove selected text from the Editor Window or from the command line of the text screen and put it onto the Clipboard. This text can be put in any new location later (either in the same or another object's contents, in the command line, or even outside SuperLogo) by choosing the Paste command.

The text currently on the Clipboard will be kept there until you cut or copy again.

The command is unavailable if you have no selected text.

Shortcut Keys: Ctrl+X


Copy (in the Object Editor)
    Copy;   Ctrl+C

This command allows you to copy selected text from the Editor Window or from the command line of the text screen and put it onto the Clipboard. This text can be put in any new location later (either in the same or another object's contents, in the command line of the text screen, or even outside SuperLogo) by choosing the Paste command.

The text currently on the Clipboard will be kept there until you cut or copy again.

The command is unavailable if you have no selected text.

Shortcut Keys: Ctrl+C


Paste (in the Object Editor)
    Paste;   Ctrl+V

This command allows you to insert a copy of the Clipboard contents at the position of the text cursor. The Paste command is unavailable if the Clipboard is currently empty.

Shortcut Keys: Ctrl+V


Find (in the Object Editor)
    Find...

Opens the Find dialogue box, in which you either type or paste from the Clipboard the text to be found. To only find matches where the case of all letters match exactly, check Match Case option.

If the text is not found in the contents of the Editor Window, an error message appears. If Logo finds the text it is highlighted.

To find the next match, either choose Find / Replace Next or press F7.


I belong to ...

  On Search Menu in File Editor


Replace (in the Object Editor)
    Replace...

Opens the Replace dialogue box, in which you either type or paste from the Clipboard the text to be found and the text to replace it. In the dialogue box you can check the following options:

to only find matches where the case of all letters match exactly, you check the Match Case option,

to replace all matches in one step, you check the All Occurrences option,

to be able to choose whether or not each match is replaced, you check the Ask Before Replacing option. Then a dialogue box appears on each match asking whether you want to replace it or not.

If the All Occurrences option is not checked, you can find the next match either by choosing Find / Replace Next or by pressing F7.


Find / Replace Next (in the Object Editor)
    Find / Replace Next;   F7

Performs the previous Find or Replace operation with the same texts (to be found and / or replaced) in the Editor Window after the last match to be found.

Function Key: F7


Next Window
  Next Window;   Ctrl+F6

Sometimes you have more than one window open at the same time within SuperLogo, for example the Memory Window, one or even more Windows with Problems to be solved, File Editor Window etc. Next Window switches from one to the other - in this way it helps to organise all Logo windows Main Window.

The Memory Window is always the first one to be switched to after selecting Next Window (if it is actually shown).

Function Key: 	Ctrl+F6


I belong to ...

  On the SuperLogo Language


Typing Instructions in the Command Line
  Typing Logo Instructions in the Command Line

You talk to SuperLogo and get it to do things through the command line:

in the text screen right next to a prompt you type one or more valid Logo instructions separated by a space,

each instruction is a command - either primitive or user-defined - (often) with values as its inputs,

the values (separated by a space) may be either simple, like 23, or a more complicated expression which must first be evaluated to find its value, like 23 + 5 * 7,

if an error occurs while your instruction is carried out, Logo stops the process, that is, it doesn't continue with the following instructions in the command line (if there are any), and prints an error message,

if  your instruction is successfully completed, the prompt is printed in the following line. It lets you know that Logo is ready for your next instruction.

The first word of any instruction is always the name of a command. Operations are only used within the expressions describing the inputs to the command. If you leave out the command, Logo will calculate the value of the expression but fail to do anything with it:

? 3 * 7

MESSAGE: I don't know what to do with 21

? PRINT 3 * 7

21


  Turtles and Turtle Geometry

SuperLogo Main Window is divided horizontally into two parts - the graphics screen and text screen. Logo can show both screens at once or only one of them. However, it always keeps the contents of the other one.

Splitting the Main Window Into Two Screens

In the graphics screen there are one or more small graphics cursors called turtles. Many Logo procedures use turtles - they make them move in the graphics screen and thus draw something with their pens. Other procedures change the turtles' settings (their positions, pen colours, their shapes etc.). We call this Turtle Graphics. Let's start with only one turtle:

Turtle's Shape

Turtles' Settings

Procedures to Work With a Turtle

Operations to Find a Turtle's settings

Multiple Turtles

Text Box Turtles


I belong to ...

  On Turtle and Turtle Geometry


  Multiple Turtles

In SuperLogo you can create up to 4000 turtles. However, when Logo starts, there is only one turtle named 0. You can create other turtles with MAKETURTLE any time you want and similarly you can erase them with ERASETURTLE. Any turtle at any time is either active or passive (not active). Logo keeps track of its turtles with two lists:

      ALLTURTLES	- list of all turtles,

      WHO	- list of all currently active turtles.

There are two important rules when working with multiple turtles:

any command to a turtle (like moving it along the screen) is carried out in parallel by all active turtles,

any operation finding any setting (like a turtle's position or its pen colour etc.) outputs the current setting of the first active turtle. If there is no active turtle, an error occurs.

To learn more about multiple turtles, study these commands:

      TELL	- to change the list of active turtles,

      ASK	- to tell a list of turtles to do something,

      EACH	- to make all active turtles do something one by one.


  Splitting the Main Window into Two Screens

The SuperLogo language provides us with commands which make Logo show only the graphics screen, or only the text screen or both. Some other commands define the size of each, when the screen is split into two parts:

      GRAPHICSCREEN	- the entire Main Window is set to graphics,

      TEXTSCREEN	- the entire Main Window is set to text,

      SPLITSCREEN	- both screens are shown,

      SETTS	- sets the size of the text screen,

      SETGS	- sets the size of the graphics screen

To find the current settings, use GETGS and GETTS. For both screens there are some more settings, like the background colour, text colour in the text screen, text cursor position, prompt etc. The Command line can never be moved outside the text screen.


  Turtle's Shape

To show a turtle in the graphics screen you can use any image, which is a special SuperLogo data object. However, a turtle's shape is not a part of the graphics screen contents - it moves a little bit "above the screen", which means it can move around the screen without changing the contents of the screen with its shape.

How to Use Frames of an Image to Show the Shape of a Turtle


  Turtle Settings

Each SuperLogo turtle has a:

name, which can be any word,

home position, that is, a position where it was created,

basic heading, that is, its initial heading when it was created,

current position in the graphics screen represented by its co-ordinates [X Y], where position [0 0] is the Origin of the graphics screen,

current heading, which is a number (in degrees) between 0 and 360,

pen state, that is, whether its pen is down, up, erasing, or reversing, current pen colour, current pen width and current pen pattern,

shape that shows the turtle in the graphics screen,

whether its shape is currently hidden or shown,

whether it is active or passive,

how the frames of the shape used: do they show turtle's current heading or are they used for animation,

name and size of font in which turtle can write any text onto the graphics screen,

whether it is in a WRAP or WINDOW mode, that is, how it acts when it meets the border of the screen.

To find out more, see also:

Procedures to Work With a Turtle

Operations to Find Turtle's Settings


  Procedures to Work With Turtles

Logo provides the following primitive procedures to work with a turtle:

      MAKETURTLE	- to create a new turtle,

      ERASETURTLE	- to erase a turtle,

      SETSHAPE	- to set a new shape for the turtle,

      GETSHAPE	- to get the turtle's current shape in the form of an image.

The most important turtle geometry procedures are:

FORWARD, SETX, SETY, SETXY, SETPOS, HOME to change turtle's current position,

LEFT, RIGHT, SETHEADING to change turtle's current heading,

PENUP, PENDOWN, PENERASE, PENREVERSE, SETPEN, SETPENCOLOUR, SETPENWIDTH, SETPATTERN to set the pen state, that is whether turtle's pen will be up, down, erasing or reversing, then what its colour, width, and pattern will be,

SHOWTURTLE, HIDETURTLE to show or hide the turtle on the graphics screen,

SETTTEXT, TTEXT to set the font and its size, with which the turtle will display text onto the graphics screen,

WRAP, WINDOW to set the turtle's actions at the border of the graphics screen.

To see the complete list:

Turtle Geometry


Operations to Find Turtle's Settings
  Operations to Find  a Turtle's Settings

Beside procedures to work with a turtle, there are primitive operations, which inform us - through their outputs - about the current turtles (turtles) settings. You can find a turtle's current pen colour, pen width, position etc.:

To find current pen state and mode, you can use:

PEN

PENCOLOUR

PENWIDTH

PATTERN

PENSTATE

To find whether the turtle is hidden or shown, you can use SHOWN?. To find current position and heading, you can use:

POS

XCOR

YCOR

HEADING

To see the complete list:

Turtle Geometry


I belong to ...

  On Types of Data in the SuperLogo Language


  Types of Data

Both primitive and user-defined commands have some effects on their inputs. In SuperLogo we classify data as either words (more exactly: symbolic words and numeric words), images and lists. For some words we can define properties. Besides data objects,  Logo works with special graphics objects called turtles.

  On the SuperLogo Language

  Logo Language Fundamentals

  Types of Data

  Words

  Images

  Lists

  Properties

  Logo Procedures Are Polymorphic


  Operations on Words

SuperLogo provides many primitive operations to work with words. The most important are:

       WORD	- to join two (or more) words,

       WORD?	- to check whether an input is a word,

       ITEM	- to get the i -th character out of a word,

       FIRST	- to get the first character out of a word,

       LAST	- to get the last character out of a word,

       BUTFIRST	- to get the same word without its first character,

       BUTLAST	- to get the same word without its last character,

       COUNT	- to find the number of characters of a word,

       EMPTY?	- to check whether an input is the empty word.

To get the complete list, see:

Word and List Operations


Words
  Words - Symbolic Atoms of Logo Language

A word is a sequence of characters (letters A, B, ... a, b, ..., digits 0, 1, ... 9, punctuation marks and special characters). Words are used as atomic elements to build more complex data - lists - and to specify properties of other words. They are also used to name user-defined procedures, variables, and turtles.

Words containing only digits (and decimal points and + or - signs) are called numbers.

  About the Case in Words

  How Long the Words Can Be

  Which Words You Can Use to Name User-Defined Procedures

  Characters with Special Meanings

  Operations on Words

  Numbers


About the Case of Words
Case of Words...

SuperLogo is normally case-insensitive, that is, it considers words like PETER and peter to be identical. To change it to be case-sensitive, use SETLOGO with [CASE 1] as its input. Be careful with this command!


Length of Words
Length of Words...

The shortest word is an empty word - its length is 0, it contains no characters. It is recognised by EMPTY?. In programming, an empty word is a quite common and useful object.

The maximum length of word is 65535 characters. However, very long words consume a lot of memory space.


  Characters with Special Meanings

Some characters have special meanings in SuperLogo. Normally, they are not used as part of any word - they are said to be input delimiters. For example, when we type:

? PRINT "AB-9

MESSAGE: - doesn't like AB as input

An error occurred, because Logo sees AB-9 as two words, AB and 9 with the difference (-) operation in between. Here is the list of special characters:

space - it separates words,

square brackets [ and ] - they enclose lists,

brackets, or parentheses,  ( and ) - they either specify the order of calculations, or enclose a procedure call with other than the basic number of inputs, like (WORD "A "B "C),

operators +, -, *, /, <, <=, <>, =, >, >=,

quotation mark " - identifies the beginning of a word,

semi-colon ; - identifies text comments in user-defined procedures definition,

swung dash ~ - specifies a long line in a user-defined procedure definition,

back slash \ - is used as an escape character to specify that the following character should not be considered special, for example "AB\-9 is one word.

To learn how to use special characters as normal ones, see more
on Escape character \.


Numbers - 'Numeric Atoms' of Logo Language
  Numbers - Numeric Atoms of Logo Language

Numbers are special kinds of words consisting only of digits 0, 1, ... 9, decimal point . and optionally + or - signs (not with their special meaning as operators here). An alternative notation for numbers - scientific notation - consists of a number followed by E and another number, for example:

24E5	denotes number 24 times 10 to the power 5,

3E-13	denotes number 3 times 10 to the power -13

Numbers are words as well, you can use any word operations on them:

? PR  57 - WORD 3 7	; see PRINT and WORD

20

? BF 12 * 12	; see BUTFIRST

44

However, numeric words are numbers, therefore:

? PR 125.0 = 0125

TRUE

  Some Operations on Numbers

  Some Operations on Words


  Some Numeric Operations

We only list some of them here. To get the complete list, see:

Numeric Operations

NUMBER? - to find whether its input is a number,

<, > , <=, >=, =, <> - predicates to find whether the first input is less than, greater than, less than or equal to, greater than or equal to, or not equal to the second input,

+, -, *, / - number operations to add, subtract, multiply, or divide its inputs,

DIV, MOD - integer division and remainder,

SIN, COS, TAN, ARCTAN - trigonometry operations,

LN, EXP - natural logarithm and exponential functions.


  Images

Images are a common SuperLogo data type. Besides their graphical applications, they behave like words: their frames correspond to the characters in words. An image containing zero frames is called an empty image. The length of an image is limited to 250 frames.

Therefore operations like FIRST, BUTLAST, or COUNT output the first frame of an image, all but the last frames of an image, number of frames, etc. Some other special image primitive procedures are:

       IMAGE?	- to find whether an input is an image,

       PUTIMAGE	- to put an image into the graphics screen,

       GETIMAGE	- to get a region of the graphics screen,

       LOADIMAGE	- to load an image from a file,

       SAVEIMAGE	- to save an image into a file.

To get the complete list, see:

Working with Images


  Lists

A list is a sequence (possibly empty) of words (symbolic or numeric), images or other lists enclosed in square brackets. Here are some examples of lists:

[ ]	- an empty list, i.e. list with no elements,

[1  2]	- list with two atomic elements,

[A  3  B]	- list with three atomic elements,

[ [ ] [ ] ]	- list with two elements, which are the empty lists,

[ [ ] [1  2] 666 [A  3  B] ]	- list with four elements: [ ], [1  2], 666, and [A  3  B]

[ [ [ [ [ ] ] ] ] ]	- list with one element, which is a list with one element, 	which ...

The number of elements (items) in a list is limited only by the size of available memory. When an image with N frames occurs in a list as its element, it is shown as {imageN}.

SuperLogo provides several primitive procedures to work with lists (we only list some of them here). Notice that many of these procedures are polymorphic:

       LIST?	- to find whether an input is a list,

       EMPTY?	- to find whether an input is an empty list,

       LIST	- to construct a list,

       SENTENCE	- to construct a list,

       FIRST	- to output the first element of a list,

       LAST	- to output the last element of a list,

       ITEM	- to output i -th element of a list,

       BUTFIRST	- to output all but the first element,

       BUTLAST	- to output all but the last element,

       COUNT	- to find the number of elements,

       FPUT	- to add new first element,

       LPUT	- to add new last element.

To see the complete list, go to:

Word and List Operations


  Procedures to Work with Properties

Properties, sometimes called property lists or words with defined properties, are another SuperLogo data type. They make it possible to connect many different 'facts' (in the form of pairs attribute - value) with one word. However, properties of a word are completely independent from a variable with the name word.

SuperLogo provides several primitive procedures to work with properties (we only list some of them here):

       PPROP	- to define a new property pair,

       REMPROP	- to remove a property,

       GPROP	- to find a value of a property,

       PLIST	- to find a complete property list,

       PPS	- to print all words together with their (non empty) property lists,

       ERASE	- to remove the complete property list of a word,

       PROPS	- to find the list of all words with at least one defined property.

To see the complete list, go to:

Property List Procedures


Logo Pocedures are Plymorphic
  Logo Procedures are Polymorphic

Notice how universal some SuperLogo procedures are:

? SH FIRST [A B C D]

A

? SH FIRST "ANDREW

A

? MAKE "A FIRST :IMAGE11	; assume IMAGE11 is a variable

; with image value

? PR :A

{image1}

This property of procedures, to do the same for different data types, is sometimes called polymorphism. A lot of user-defined procedures can be defined polymorphic:

TO SPECIAL.SQUARE :Z

IF EMPTY? :Z [OP :Z]

LET "one FIRST :Z

OP FPUT :one * :one SPECIAL.SQUARE BF :Z

END

? SH SPECIAL.SQUARE [1 2 3 4]

[1 4 9 16]

? SH SPECIAL.SQUARE 1234

14916


Sounds
  Sounds and Multimedia

Besides texts and graphics, SuperLogo makes it possible to use any multimedia device through the MCI procedure or to produce simple tones. SOUND can play a sequence of tones (or more general - sounds) set by their frequency and duration, PLAY can play musical notes and includes some other features like octave, tempo, # or b for sharp or flat notes, whole notes, half notes, quarter notes etc. PLAYWAVE can play the melody (or melodies) encoded in specified .WAV file (or .WAV files).


  Inputs and Outputs of Logo Procedures

Many Logo procedures - both primitive and user-defined - get additional data through their inputs which must be valid data objects. Some of these procedures calculate and output values as their results - these procedures are called operations and their results are called outputs.

When a Logo instruction is typed into the command line and you press Enter, it is immediately carried out

First the whole expression is analysed and divided into separate words and lists, then all of these parts are evaluated from the left to the right. The first of the line must be the name of the Logo command to be executed. This word is followed by zero or more expressions which are separated from each other by spaces (or by other characters with special meaning). These expressions are first evaluated and their values (results) become inputs to the command.

See also:

Basic and Variable Number of Inputs


  Rules for Evaluating Inputs

If the input expression is a word prefixed by a colon (:), its value is the value of a variable with that name.

If the input expression is a number (a numeric word), its value is the same number.

If the input expression is a combination, for example an arithmetic expression, like 23 * 5 + :VAR1, its sub expressions are evaluated, operations are applied to the partial values (in the usual way and according to rules of priority). The total result becomes the value of the expression.

If the input expression is the name of a Logo procedure, the input expressions are evaluated first and then the procedure is executed with their values as its inputs. If the procedure is an operation, the result obtained in this way becomes the value of the whole procedure call.

If the input expression is a word prefixed by a quotation mark ("), its value is the word itself - we call this kind of input expression a quotation of the input word.

If the input expression is a list, it is not evaluated and becomes the result, that is, the output value.

For example: MAKE expects two inputs, a name and a value. Therefore the instruction

? MAKE "ABC 1 + :XYZ

will be evaluated in the following steps:

the first input will be the word ABC (after evaluation it will have " removed),

the second input will be obtained as a value of the expression 1 + :XYZ, i.e. the sum of number 1 and value of the variable named XYZ (for example, 10),

MAKE is executed with the inputs ABC and 11, thus creating the new variable ABC with the value 11,

as no more instructions follow the first one, the evaluation is completed.

Brackets are used in SuperLogo:

to group sub expressions together so they are evaluated differently from the usual order. For example, 1 + 2 * 3 produces 7, while (1 + 2) * 3 produces 9,

to specify varying number of inputs to some Logo procedures.


  Basic and Variable Number of Inputs

Any Logo primitive procedure has a given number of  inputs. Some procedures, however, accept not only their basic number of inputs, but a variable number of inputs as well. In this case, brackets must be used to tell Logo which input expressions belong to this particular procedure - this must be done each time the number of input expressions is not basic. As an example, let's look at PRINT. Its basic number of inputs is 1. Therefore:

? PR "GOOD

GOOD

? PR "GOOD "MORNING

GOOD

MESSAGE: I don't know what to do with MORNING

? (PR "GOOD "MORNING)

GOOD MORNING

? MAKE "A 123456

? (PR "VALUE "OF "VARIABLE ":A "IS :A)

VALUE OF VARIABLE :A IS 123456

or

? (PR [VALUE OF VARIABLE :A IS] :A)

VALUE OF VARIABLE :A IS 123456

Obviously, no command can be used as an input expression to any procedure, because commands have no output value and they do not output anything to act as an input to other procedures (see how Logo procedures are divided into commands and operations):

? SHOW PRINT 44

44

MESSAGE: PRINT didn't output anything to SHOW


Conditional Procedures
  Conditions and Predicates, Logical Operators

Operations which output TRUE or FALSE are called conditions or predicates. Examples of such operations are the numeric predicates <, >, <=, >=, <>, and =. TRUE is a word meaning that a certain condition is true, FALSE means the condition is not true. Several Logo procedures expect one of their inputs to be TRUE or FALSE, like IF or TEST.

SuperLogo provides the following operations which make it possible to combine simple conditions into more complex ones:

      AND	- outputs TRUE, if all its inputs are TRUE; otherwise outputs FALSE,

      OR	- outputs FALSE, if all its inputs are FALSE; otherwise outputs TRUE,

      NOT	- outputs TRUE, if its input is FALSE; otherwise outputs FALSE.


File Management
  Working with Files

Although your work in Logo will usually be a project, it is possible to save information (and later read it back) in more kinds of files.

File Names ...

Logo Recognises Different File Extensions...

Procedures to Load and Save Files

How to Read from a File and Print to a File


  Procedures to Load and Save Files

Basic Logo commands to save information in files are:

       SAVE	- to save procedures, variables, and properties,

       SAVEIMAGE	- to save images,

       SAVELIBRARY	- to save special projects called libraries,

       SAVESCREEN	- to save complete screens or parts of screens,

       SAVEBITMAP	- to save an image in the form of a bitmap.

Basic Logo procedures to read information from files are:

       LOAD	- to read procedures, variables, and properties,

       LOADIMAGE	- to read an image,

       LOADLIBRARY	- to read a library,

       LOADSCREEN	- to read another screen (either complete or part of a screen),

       LOADBITMAP	- to read a bitmap and convert it into an image.


  How to Read from a File and Print to a File

The standard input stream (coming from the keyboard) can be redirected by READFROM to come from a text file. From now on all READCHAR, READWORD, and READLIST Logo operations will read characters, words, and lists (that is, lines) from the file specified in READFROM. Notice that READKEY always reads codes from the keyboard (or mouse), even if all other reading operations read from a file, which makes it possible to create more interactive programs. To redirect the standard input stream to come from the keyboard again you have to type in READFROM [ ].

The standard output stream can be redirected from the text screen into a file with PRINTTO specifying the name of a text file you are going to create (or rewrite). From now on all PRINT, PRINTLINE, TYPE, and SHOW commands will print their inputs into this file (instead of the text screen). To direct the standard output stream back to the text screen you have to type in PRINTTO [ ].

Some Examples of Printing to and Reading from a file...


I belong to ...

  On Programming in SuperLogo


Conditional Procedures, IF
  Conditional Procedures

The IF command is the basic procedure dealing with conditional calculations and instructions in Logo. You can use it with either two or three inputs. Let's use it with two inputs first.

The first input to IF must be either TRUE or FALSE, the second is a list of Logo instructions. If the first input is TRUE, the instructions in the list are carried out, otherwise nothing happens:

? IF :A < 2 [ PR "IS.LESS.THAN ]

Before IF is executed, both input expressions are evaluated:

the value of :A < 2 is either TRUE or FALSE, depending on the value of variable A,

the value of the list [PR "IS.LESS.THAN] is the list itself.

Depending on the value of variable A procedure IF either executes the second list or not. Executing it means to print the word IS.LESS.THAN.

Procedure IF with three inputs expects a second list of instructions beside the word TRUE / FALSE and the first list of instructions. This second list will be executed if the first input is FALSE:

? IF WORD? [A B C] [PR "IS.WORD] [PR "IS.NOT.WORD]

IS.NOT.WORD

IF can also be used as an operation (see how Logo procedures are divided) with three inputs (it cannot be an operation without the third input). Its second and third inputs are Logo expressions which produce an output when executed. Therefore IF either returns the output of its second input (if the first word is TRUE) or the output of its third input otherwise:

? IF WORD? [A B C] [FIRST [YES NO] ] [LAST [YES NO] ]

MESSAGE: I don't know what to do with NO

? PR IF WORD? [A B C] [FIRST [YES NO] ] [LAST [YES NO] ]

NO

Another way use conditional calculations in SuperLogo is provided by these three procedures: TEST, IFTRUE, and IFFALSE.


TEST, IFTRUE, and IFFALSE
  TEST, IFTRUE, and IFFALSE - Alternatives to IF

To avoid the very long lines which may appear in your programs when using IF (as the whole instruction must fit into one line), SuperLogo provides two alternatives:

you can use the swung dash (~) special character to divide one long "logical line" into several "physical lines". SuperLogo considers lines connected by ~ as one logical line and evaluates it as a whole.

you can "divide" long IF line into two or more lines by using TEST, IFTRUE, and/or IFFALSE instead of one IF command:

TO DECIDE :WHAT

    TEST AND (FIRST :WHAT < 0) (LAST :WHAT > 10)

    IFT [OP (FIRST :WHAT) + LAST :WHAT]

    IFF [OP (FIRST :WHAT) - LAST :WHAT]

END

Where to use TEST, IFTRUE, and IFFALSE


  Repetition Commands

The Logo repeating primitive procedure REPEAT expects two inputs:

the first of them is a number setting how many times something will be repeated,

the second is a list of complete Logo instructions.

The second input is executed as many times as specified by the first input. For example:

? MAKE "A "X

? REPEAT 5 [MAKE "A WORD "X :A PR :A]

REPEAT will execute the list of instructions five times; it will change variable A and print it five times:

XX

XXX

XXXX

XXXXX

XXXXXX

If the first input is less than 1, the following list is never executed. For more advanced examples see also REPEAT and REPCOUNT and other repeating procedures:

FOR

FOREACH

WHILE

RUN

EACH


  RUN Procedure

RUN expects one input - a list of complete Logo instructions. RUN executes (runs) the list. For example:

? RUN [PR "FIRST PRINT "SECOND]

FIRST

SECOND

You could do the same by typing two instructions PR "FIRST PRINT "SECOND with no brackets and no RUN command. However, RUN is a very powerful and useful procedure when you have to execute a list of instructions which is the value of a variable or is actually constructed by a procedure:

? MAKE "A [PR [A B C] ]

? RUN :A

A B C

Notice that IF and REPEAT can be used in a similar way:

? IF "TRUE :A	; or

? REPEAT 1 :A

TO MAP.IT :FUN :LIST

IF EMPTY? :LIST [OP :LIST]

LOCAL [WHAT]

MAKE "WHAT RUN (LIST :FUN "FIRST :LIST)

OP FPUT :WHAT MAP.IT :FUN BF :LIST

END

? SH MAP.IT "NUMBER? [1 Q 2 DD 2A]

[TRUE FALSE TRUE FALSE FALSE]

Also note that the operation defined above is (nearly) the same as the Logo primitive operation MAP.


  How to Define Our Own Procedures

You can define our own procedures either with TO or DEFINE; in the Object Editor started with EDIT, or in the same editor started from the Memory Window.

Parts of the Procedure's Definition

How to Define a Procedure with Variable Number of Inputs

Defining Procedure in the Command Line

Procedures TEXT and DEFINE

See also:

How to Define Your Own Operations


  Parts of the Procedure's Definition

Any procedure's definition created with TO must consist of three parts:

heading line starting with TO, which is followed by the procedure's name, and zero, one, or more names of the procedure's inputs,

one or more lines acting as the procedure's body - these lines describe the procedure's actions, its effect (if it is a command), or the way its output is calculated (if it is an operation),

a final line containing only END which closes the definition.

Names of procedure's inputs (also called formal parameters) are the names of local variables which will be created whenever the procedure is executed and are automatically erased when procedure is finished.


I belong to ...

  On Defining Your Own Procedures


  How to Define a Procedure with a Variable Number of Inputs

Each SuperLogo primitive procedure has a fixed number of inputs, however, some of them accept a variable number of inputs, like PRINT. In this case, the whole instruction must be enclosed in brackets:

? (PRINT "A "B "C)

A B C

This is true with user-defined procedures as well. Most of your own procedures accept a fixed number of inputs (set by the number of inputs in the heading line of the definition). However, you can also define your own procedures with a variable number of inputs. For these procedures the heading line consists of:

TO followed by the procedure's name,

the only name of the input,

a list with one element [N] - where N is a number specifying the basic number of procedure's inputs, for example:

TO DOUBLE :WHAT [ 1 ]

    OP SE :WHAT :WHAT

END

If you use this operation with one input - the basic number of inputs, you don't use any brackets. If you use it with a different number of inputs, you have to use brackets:

? PR DOUBLE "HELLO

HELLO HELLO

? PR (DOUBLE "HELLO "THERE)

HELLO THERE HELLO THERE

The name of the input (in our example :WHAT) is in the definition used in the following way: it is always the list of all inputs. For example, if you type in:

? PR (DOUBLE  "WHO "ARE "YOU)

the body of DOUBLE's definition is executed with :WHAT being a list [WHO ARE YOU ].


  Defining Procedures in the Command Line

Beside defining a procedure in the Memory Window you can also define it in the command line with TO. After typing in TO with the name of a new procedure (and its inputs), Logo switches into procedure definition mode, which is indicated in the text screen by the > prompt. Logo uses the following lines as lines of the procedure's definition. Logo will switch back to standard dialogue mode if you type END on a separate line:

? TO FIRST.EXAMPLE

> MAKE "L [ ]

> REPEAT 5 [MAKE "L FPUT "A :L PRINT :L]

> END

Now FIRST.EXAMPLE procedure can be used in the command line:

? FIRST.EXAMPLE

A

A A

A A A

A A A A

A A A A A

This procedure doesn't expect any input. Instead, it uses one global variable L. SECOND.EXAMPLE procedure expects one input named X:

? TO SECOND.EXAMPLE :X

> IF EMPTY? :X [STOP]

> PR :X

> SECOND.EXAMPLE BF :X

> END

Notice that SECOND.EXAMPLE executes itself in its last line. This kind of procedure is called recursive. You can now use it in the command line:

? SECOND.EXAMPLE "WORD

WORD

ORD

RD

D

? SECOND.EXAMPLE [this is a list]

this is a list

is a list

a list

list


  Procedures TEXT and DEFINE

The Logo primitive operation TEXT gets one input which must be the name of a user-defined procedure. Its output will be a list showing the definition of this procedure - we call it a definition list. For example:

? TO PRINT.ALL :X

> IF EMPTY? :X [STOP]

> PR :X

> PRINT.ALL BF :X

> END

? SH TEXT "PRINT.ALL

[ [X] [IF EMPTY? :X [STOP] ] [PR :X] [PRINT.ALL BF :X] ]

DEFINE expects two inputs - a name to be the name of the new procedure, and a definition list. It creates a new procedure with the body specified by the second input. The following instruction:

? DEFINE "XYZ BL TEXT "PRINT.ALL

defines the procedure XYZ which is similar to PRINT.ALL except its last line was omitted.


  How to Define Your Own Operations

User-defined operation is a procedure that outputs a value. To specify its output, you have to make use of the Logo primitive command OUTPUT. Whenever Logo runs into an OUTPUT command, it stops (like the STOP command) that particular procedure and outputs what OUTPUT received as its input:

? TO MIN :A :B

> IF :A < :B [OUTPUT :A]	; output :A

> OUTPUT :B	; otherwise output :B

> END

?

MIN outputs one of its inputs, therefore it must be used as an expression which produces a value. There must be another Logo procedure (primitive or user-defined) which waits for this result, otherwise an error occurs:

? PRINT MIN 16 12

12

? MIN 11 17

MESSAGE: I don't know what to do with 11


  Comments in Procedures

Lines of a procedure definition containing a semi-colon (;) are used in a special way: text to the left of ; is a normal line, while text to the right of ; is a comment. In this way you can put some short explanations or notes into our definitions, which may help you understand and document the programs. For example:

? TO PRINT.ALL :X

> IF EMPTY? :X [STOP]	; if the input is empty, stop

> PR :X	; otherwise: print :X and

> PRINT.ALL BF :X	; repeat for the input without first element

> END

?

See also:

How to Define Your Own Procedures

How to Define Your Own Operations


  Working with Procedures

User-defined procedures, like any other user-defined object, can be not only created, but changed, printed out, or erased. The primitive Logo language command to print out a user-defined object is PO (Print Out). Its input is either the name of a user-defined object, or a list of objects. For example:

? PO [SQUARE :VAR "ELEPHANT]

will print to the text screen the definition of the procedure SQUARE, the name and the value of variable VAR, and all the properties of the word ELEPHANT.

Another Logo language command, ERASE, with the same type of inputs, erases all specified user-defined procedures (and other objects) from the Memory Window. As an input to all of the commands mentioned above, you can also use the value of any of the following operations:

PROCS - its value is the list of all user-defined procedures (which are not buried, unless you temporarily unbury them with SETBURY "FALSE - this is true for following two operations as well),

NAMES - its value is the list of all user-defined variables,

PROPS - its value is the list of all words for which you have defined properties.

What Do PROCS, NAMES, and PROPS Lists Look Like

Therefore:

? PO NAMES	; prints all variables,

? ERASE PROCS	; erases all user-defined procedures,

? SAVE "XX PROPS	; saves into XX.LGO file all words

; which have properties

For more details, see:

Defining, Editing and Working with Procedures


How and Why You Bury Our Own Objects
  Buried Objects

In certain situations it is useful to hide (to bury in Logo terms) some of the user-defined objects.

How and Why You Bury Memory Objects...

Creating and Using a Library...

How Logo Displays and Processes Buried Objects


  How an Instruction is Debugged

When a DEBUG command is entered from the command line of the text screen, the debugging mode starts. In this mode, the Step by Step Window appears on the screen. Debugging can either help you develop your program or provided a way of finding and fixing errors (called bugs) in your program. The instruction to be debugged is the input of the DEBUG command. This must be a list of one or more valid Logo instructions:

? DEBUG [MOVE.ME 200 TURN.ME 75]

Obviously, there is no need to debug Logo instructions like:

? DEBUG [FD 200 RT 90]

Debugging in SuperLogo is line oriented, that is, the smallest unit to be worked on in one step is always the contents of the whole line.

  Step by Step Window


I belong to ...

  On Debugging in SuperLogo


  Step by Step Window Control Menu

To learn more about the menu commands, click on  them with the mouse.

This menu contains commands that allow you to set options for debugging. A check mark appears next to them when they are selected.


  Step by Step Window Buttons

To learn more about the window buttons, click on them with the mouse.

This window contains seven control buttons which make it possible to debug or trace an instruction in several ways. To find more about any button, click it with the mouse.


Step by Step Window
  Step by Step Window ...

This window provides a complex debugging, developing, and tracing tool.

  Step by Step Window

  Its Control Menu

  Its Buttons

The Step by Step Window can be used during any instruction in the DEBUG command from the command line. There are seven buttons which control the way the instructions flow. It can be used in:

the text screen only to trace the instructions through text messages. The level of detail of these messages can be set from the Step by Step Window Control Menu,

the graphics screen only to see the instructions in basic steps,

within the Memory Window to see the definitions of your procedures, the values of global and local variables or the words with defined properties. Some of these objects can be modified while the instructions are running,

in any combination of the Memory Window and either text screen or graphics screen, or both.


Close          Alt+F4

Use this command to stop the debugging process and close the Step by Step Window.


Write Steps

If this option is selected, a full text message starting with

STEP:

is printed into the text screen followed by the contents of the currently executed line of your procedure. This is done for each executed line.

This option is always selected (is on), when you start Logo.


Write Procedure Entry and End

If this option is selected, a message

PROC ENTRY: name_of_the_procedure entered

is printed into the text screen whenever the instructions enter a user-defined procedure. A similar message

PROC END: name_of_the_procedure closed

is printed whenever the execution of a user-defined procedure is finished.

This option is always selected (is on), when you start Logo.


Enter Closed Procedure

If this option is not selected (is off), any user-defined sub-procedure, which is not open in the Memory Window, is treated as a single statement. (By sub-procedure we mean any user-defined procedure which is called from the procedure being debugged.) Otherwise, whenever a closed procedure is called, Logo first opens it in the Inspection Area of the Memory Window and traces through it line by line.

This option is always selected (is on), when you start Logo.


Eliminate Tail Recursion

is not on when you start Logo, which means that tail recursive calls are displayed as truly recursive (with increasing indentation). If you check this option, tail recursion is shown more like a REPEAT iterative instruction.


Control Menu of Step by Step Window

To learn more about the Control Menu of the Step by Step Window, see:

  Control Menu


One Step Button...

executes the next line of the computation being traced. If the Memory Window is open, the executed line is highlighted. This is the most important button in the Step by Step Window, because it allows you to execute the instructions one line at a time. If the Write Steps option of the window's Control Menu is checked, the contents of the line is printed into the text screen. If the Enter Closed Procedures option of the window's Control Menu is checked and next line of the computation contains a call of another user-defined procedure (let's call it a sub-procedure), Logo enters the sub-procedure and steps through it line by line (even if the Memory Window is actually hidden). If the option is not checked and the sub-procedure is closed in the Memory, a line which calls a sub-procedure is treated as a single step. (This is true both when the Memory is hidden or shown.)


Step Over Button...

like the One Step button, it executes one line of the instructions. The difference is that any call to a sub-procedure in the executed line is treated as a single step. However, if PAUSE is found during "stepping over", the step is not finished - it stops in the line following the line with PAUSE in it, even if it is in a sub-procedure or a sub-sub-procedure etc. The same is true if you click the Pause button while "stepping over" is on. In this case the instruction stops at the line following the line having been executed when Pause was pressed. Paused instructions can be continued with any button in the window (except Pause and Stop).


Finish Active Procedure Button...

executes in one step the rest of the active procedure and thus either finishes the rest of the instructions, or finishes the sub-procedure being executed and returns to its calling procedure in the chain of active procedures. However, if a PAUSE is found, the active procedure is not finished - Logo stops in the line following the line with PAUSE, even if it is in a sub-procedure or a sub-sub-procedure etc. The same is true if you click the Pause button while "finishing active procedure" is running. In this case the instructions stop at the line following the line having been executed when Pause was pressed. Paused instructions can be continued with any button in the window (except Pause and Stop).


Finish All Button...

finishes in one step the rest of the instructions being stepped through. However, if PAUSE is found during "finishing all", the instruction is not finished - it stops in the line following the line with PAUSE, even if it is in a sub-procedure or a sub-sub-procedure etc. The same is true if you click the Pause button while "finishing all" is running. In this case the instruction stops at the line following the line having been executed when Pause was clicked. Paused instructions can be continued with any button in the window (except Pause and Stop).


See Instructions Button...

runs all instructions, highlighting each line as it is executed, but without pausing. This button shows you the flow of the instructions. Rules about the PAUSE command and Pause button are the same as for One Step, Step Over, Finish Active Procedure and Finish All Buttons.


Pause Button...

interrupts the computation (in the similar way to PAUSE) and stops in the following line. Paused instructions can be continued with any button in the window (except Pause and Stop).


Stop Button...

interrupts stepping completely so that it can't be continued. Clicking this button during the instructions (for example, when Finish All or Step Over is used), has the same effect as clicking Stop in the Speed Bar, or pressing the F12 function key.


  List of Error Messages

If an error occurs in an instruction, it is stopped and an error message appears. Normally, error messages are printed into the text screen. They consist of one short sentence. (However, it is also possible to use ERROR to get the complete error message.)

? MOVE 125

Error: I do not know how to move

Through SETLOGO with ERROR or by selecting Errors to Pop-Up Window in the Options Menu you can redirect error messages to appear in the Error Window. In most cases, the message in the Error Window is more detailed. In the following list of error messages will you see:

  the number of the error which can be obtained only with ERROR,

  some text (here printed in bold) which appears either in the text screen or as a first sentence in the Error Window,

  one or more additional texts used only in the Error Window as the additional information.

  How to Make Your Own Error Message, see MAKEERROR

All the red words in the following list would be replaced by procedure names, values etc. in the actual messages.

1  I don't know what to do with Value

You should tell Logo what to do with the result of the calculation

2  Logo Procedure doesn't like Value as its input

Procedure Logo Procedure expected a word or an image as its input

Number of frames in an image is limited to 250

Don't use an empty list as an input to Logo Procedure

Don't use an empty word as an input to Logo Procedure

Your image hasn't enough frames for Logo Procedure

Procedure Logo Procedure expected a list as its input

Procedure Logo Procedure expected an image as its input

Procedure Logo Procedure expected a word as its input

Operation Logo Procedure expected a positive number as its input

Don't use negative number as an input to the operation Logo Procedure

Operation Logo Procedure doesn't expect this value as its input

Structure of the input list is not correct for Logo Procedure

There are not enough frames in it -  run out of frames

There are not enough characters in it -  run out of characters

There are not enough elements in it -  run out of elements

Operation Logo Procedure expected a number as its input

Logo Procedure expected a list of 2 elements

Logo Procedure expected a list of 4 elements

Logo Procedure expected a file of .WAV type as its input

Logo Procedure didn't expect such a long word as its input

Logo Procedure didn't expect this procedure as its input

Procedure Logo Procedure expected a colour triple [r g b] as its input

Logo Procedure expected a list of 4 or 5 elements

Don't use an empty image as an input to Logo Procedure

3  Variable Word has no value

Use MAKE or NAME commands to define a value for a variable

4  I don't know how to Word

Either you made a mistake in typing or haven't defined it yet

5  Internal error in Logo Procedure

No space to create new turtles

Not able to start Image Editor

Connection with Image Editor is lost

Not able to start Image Editor - close one or more applications

Not enough memory for the graphics screen

Not able to evaluate an expression

Cannot create a temporary file

6  Logo Procedure doesn't like Value as its input

Logo Procedure expected a number between Number and Number, inclusive

Logo Procedure expected either a list or a number between Number and Number, inclusive

7  Logo Procedure needs more inputs

Procedure Logo Procedure is defined to process more inputs than you specified

Property list must have even number of elements

8  Unexpected )

Number of left and right parentheses must be the same

9  Out of space

10  Value is neither TRUE nor FALSE

11  Procedure Word is a SuperLogo primitive

You can't redefine it - choose another name

You can't see its definition

12  Missing )

13  Wrong sequence of operators

14  You tried to divide by zero

Make sure divisor is never 0

15  Logo Procedure didn't output anything to Word

Logo Procedure is not an operation - it never outputs a value

16  Logo Procedure used in a wrong place

Logo Procedure can be used only inside a procedure definition

Don't use Logo Procedure inside ASK or EACH procedures

Editor can be started only from the command line

Load files only from the command line

Logo Procedure can be only used to close the definition of your procedure

Command Logo Procedure can be only used to start a procedure definition

Don't use DEBUG command when already debugging

Logo Procedure can be used only inside a REPEAT

Debug only from the command line

17  Too many inputs to Logo Procedure

Procedure Logo Procedure is not able to process so many inputs

18  Word too long for Logo Procedure

The length of words is limited to 65535 characters

19  A title line can't start with Word word

20  Procedure Logo Procedure has not been executed yet

21  I can't find CATCH for Word

You can use Logo Procedure only inside CATCH command

22  Too many things inside ( )

23  Too many inputs defined for Logo Procedure

Number of inputs to a procedure is limited to 255 inputs

24  Procedure Logo Procedure already exists, EDIT it

25  STOP

26  I have a problem with file Word

File containing an image has less frames than you want to use

It can't be saved. Your disk may be full or write protected

New screen file can't be loaded. Make sure it is of .BMP type

Screen can't be saved. Is your disk full or write protected?

It can't be loaded. Make sure the file exists and is of the expected type

27  Number Number is too big

28  Real arithmetic error when processing Logo Procedure

29  I can't edit Word

Not able to start the editor

When images are included in a list, split it into parts and edit them separately

A line in it is too long

Variable with an image value can't be edited

Procedure with the same name already exists

Variable with the same name already exists

This word already has some properties defined

Local variable Word has no value yet

Procedure Logo Procedure is active

30  Too many turtles

Number of turtles is limited to 4000

31  When doing Logo Procedure I don't know turtle Word

Use MAKETURTLE command to make a turtle and name it with any word you want

32  No turtle is active for Logo Procedure

Use TELL to make a turtle active

34  Word Word has no properties defined

Use PPROP to define a property for a word

35  Recursion is too deep for EACH or ASK

36  Wrong operation with image or images

Don't combine words and images

37  Not able to set screen dimensions

38  Incorrect Word directory

39  No Problems defined

40  No Demo projects defined

42  Value can't be name of a procedure

Don't use an empty word, a number, a word starting with : or  or with special meaning

43  Word can't be erased

Local variable Word has no value yet

Procedure Logo Procedure is active

Procedure Logo Procedure doesn't exist

Procedure Logo Procedure is a SuperLogo primitive

44  Unexpected ]

Number of left and right brackets must be the same

45  No connection with the printer

SuperLogo is still active, although it can't print

46  Not enough memory to perform this operation

SuperLogo is still active, although the operation has not been performed

47  Not enough memory to keep the text

48  MCI error: mci_message


  Error Window

To learn more about the window, click on its components in the picture with  your mouse.

This window opens whenever an error occurs and all error messages are redirected to go into a separate window either by SETLOGO with ERROR or by selecting Errors to Pop-Up Window Options Menu command.

  List of Error Messages


First Part of the Error Message ...

contains a short description of the error. The same sentence may appear for the whole group of errors.


Second Part of the Error Message ...

contains additional information with more detailed explanation. This text differs for different error situations of the same group as specified by the first part of the Error Message.


Title Line ...

of the Error Window contains:

  either only the word Error  - if the error situation occurred while running a Logo primitive procedure or inputs in the command line, or

  the text specifying the name of the user-defined procedure (and its line) in which the error occurred - if the error happened while running a call to any user-defined procedure.


OK Button ...

closes the Error Window. To close the window, you can also press the Esc key.


Help Button ...

opens this Help SLOGO.HLP file. SuperLogo tries to open the most appropriate topic - depending on the  particular error.


Edit Button ...

is active only when an error occurred in a user-defined procedure. If you press the Edit Button in this case, the Object Editor opens with the definition of the procedure in which the error occurred - this procedure is specified by its name in the title bar of the Error Window. The editor cursor  is located at the beginning of the line which caused the error.

If the error happened while a Logo primitive procedure was being run from the command line of the text screen, the Edit Button is disabled.


  Colour Transformations in Loading and Saving Graphics

When loading or saving your Logo projects with screens and images, or when loading or saving any bitmaps or images, you have to consider the graphics mode in which you are working and in which your project or graphics may be used on other computers. SuperLogo recognises 4 of the most common graphics modes:

standard VGA 16 colours with palette,

256 colours with palette,

65 536 colours without palette,

16 777 216 colours True Colour (without palette).

Sometimes you have to work with graphics already saved in graphics files (bitmaps or images) where each pixel is coded either by 1 bit (monochromatic graphics), 4 bits (16 colours), 8 bits (256 colours), or 24 bits (16 777 216 colours called True Colour). Sometimes you have to save your graphics to match one of these formats - different from the one you are using on your computer. This may happen while:

loading graphics with LOADSCREEN, LOADBITMAP, LOAD, LOADLIBRARY, LOADIMAGE, and also loading a project with Open Project from the File Menu in the Main Window,

saving graphics with SAVE, SAVEBITMAP, SAVEIMAGE, SAVELIBRARY; SAVESCREEN and also saving a project with Save Project from the File Menu in the Main Window.

To understand the following table, you have to be familiar with several options of the SETLOGO command, namely MAXBMPCOLOURBITS and MAXIMAGECOLOURBITS.

Meaning of the following table: For example,

Saving Monochromatic Graphics in  ...  standard VGA 16 colours graphics mode,

it will mean that you are working in standard VGA mode with 16 colours and want to save your graphics as monochromatic (1 bit per pixel coding).


Loading Monochromatic Graphics in ...

standard VGA 16 colours graphics mode:

when using LOADSCREEN with only one input (that is, loading the whole screen), the result will be a black and white screen,

when using LOADSCREEN with two inputs (that is, loading only a part of a screen), the two colours of the loaded bitmap will be displayed in the following way: white pixels will become identical to the background colour (specified by SETBACKGROUND) and black pixels will become identical to pen colour of the first active turtle,

loading monochromatic images is not supported by SuperLogo.


Loading Monochromatic Graphics in ...

256 colours with palette graphics mode:

when using LOADSCREEN with only one input (that is, loading the whole screen), the result will be a black and white screen,

when using LOADSCREEN with two inputs (that is, loading only a part of a screen), two colours of the loaded bitmap will be displayed in the following way: white pixels will become identical to the background colour (specified by SETBACKGROUND) and black pixels will become identical to the pen colour of the first active turtle,

loading monochromatic images is not supported by SuperLogo.


Loading Monochromatic Graphics in ...

65536 colours without palette graphics mode:

when using LOADSCREEN with only one input (that is, loading the whole screen), the result will be a black and white screen,

when using LOADSCREEN with two inputs (that is, loading only a part of a screen), two colours of the loaded bitmap will be displayed in the following way: white pixels will become identical to the background colour (specified by SETBACKGROUND) and black pixels will become identical to the pen colour of the first active turtle,

loading monochromatic images is not supported by SuperLogo.


Loading Monochromatic Graphics in ...

16777216 colours (True Colour) graphics mode:

when using LOADSCREEN with only one input (that is, loading the whole screen), the result will be a black and white screen,

when using LOADSCREEN with two inputs (that is, loading only a part of a screen), two colours of the loaded bitmap will be displayed in the following way: white pixels will become identical to the background colour (specified by SETBACKGROUND) and black pixels will become identical to the pen colour of the first active turtle,

loading monochromatic images is not supported by SuperLogo.


Loading 16 Colours Graphics (standard palette) in ...

standard VGA 16 colours graphics mode:

is done without any special transformations, modifications or consequences for the SuperLogo User or the graphics.


Loading 16 Colours Graphics (standard palette) in ...

256 colours with palette graphics mode:

bitmaps and images may be modified by displaying colours 1 to 6 slightly darker than in standard VGA graphics mode.


Loading 16 Colours Graphics (standard palette) in ...

65536 colours without palette graphics mode:

bitmaps and images may be modified by displaying colours 1 to 6 slightly darker than in standard VGA graphics mode.


Loading 16 Colours Graphics (standard palette) In ...

16777216 colours (True Colour) graphics mode:

bitmaps and images may be modified by displaying colours 1 to 6 slightly darker than in standard VGA graphics mode.


Loading 256 Colours Graphics in ...

standard VGA 16 colours graphics mode:

each colour of the loaded graphics (bitmap or image) will be changed into the closest colour in the standard 16 colour palette.

The same is true for 16 colours graphics files with non-standard palettes.


Loading 256 Colours Graphics in ...

256 colours with palette graphics mode:

is done without any special transformations, modifications or consequences for the SuperLogo User or the graphics.

The same is true for 16 colours graphics with non-standard palettes.


Loading 256 Colours Graphics in ...

65536 colours without palette graphics mode:

some colours of the loaded graphics (bitmap or image) may be slightly changed. However, except in very special cases, this change will be hardly noticeable by the SuperLogo user.

The same is true for 16 colours graphics with non-standard palettes.


Loading 256 Colours Graphics in ...

16777216 colours (True Colour) graphics mode:

is done with no problems or changes.


Loading 16777216 Colours (True Colour) Graphics in ...

standard VGA 16 colours graphics mode:

each colour of the loaded graphics (bitmap or image) will be changed into the closest colour in the standard 16 colour palette.


Loading 16777216 Colours (True Colour) Graphics in ...

256 colours with palette graphics mode:

this process may take up to several minutes because a palette of 256 colours must be created by analysing each pixel of the loaded graphics (bitmap or image). This palette will always contain the 16 colours of the standard palette plus up to 240 different colours encountered when analysing the loaded graphics. All other colours in the graphics will be transformed into this palette.

The transformation process is shown by a special mouse cursor:


Loading 16777216 Colours (True Colour) Graphics in ...

65536 colours without palette graphics mode:

some colours of the loaded graphics (bitmap or image) may be slightly changed. However, except very special cases, this is hardly noticeable to the SuperLogo user.


Loading 16777216 Colours (True Colour) Graphics in ...

16777216 colours (True Colour) graphics mode:

is done without any special transformations, modifications or consequences for  the SuperLogo User or the graphics.


Saving Monochromatic Graphics in ...

standard VGA 16 colours graphics mode:

must be specified before saving by setting MAXBMPCOLOURBITS (for bitmaps) or MAXIMAGECOLOURBITS (for images) to 1 with SETLOGO.

All colours in the graphics will be transformed to black and white by the installed screen driver - therefore the process can result in different graphics for different screen drivers.


Saving Monochromatic Graphics in ...

256 colours with palette graphics mode:

must be specified before saving by setting MAXBMPCOLOURBITS (for bitmaps) or MAXIMAGECOLOURBITS (for images) to 1 with SETLOGO.

All colours in the graphics will be transformed to black and white by the installed screen driver - therefore the process can result in different graphics for different screen drivers.


Saving Monochromatic Graphics in ...

65536 colours without palette graphics mode:

must be specified before saving by setting MAXBMPCOLOURBITS (for bitmaps) or MAXIMAGECOLOURBITS (for images) to 1 with SETLOGO.

All colours in the graphics will be transformed to black and white by the installed screen driver - therefore the process can result in different graphics for different screen drivers.


Saving Monochromatic Graphics in ...

16777216 colours (True Colour) graphics mode:

must be specified before saving by setting MAXBMPCOLOURBITS (for bitmaps) or MAXIMAGECOLOURBITS (for images) to 1 with SETLOGO.

All colours in the graphics will be transformed to black and white by the installed screen driver - therefore the process can result in different graphics for different screen drivers.


Saving 16 Colours Graphics in ...

standard VGA 16 colours graphics mode:

is done without any special changes or consequences for the SuperLogo User.


Saving 16 Colours Graphics in ...

256 colours with palette graphics mode:

Images: if MAXIMAGECOLOURBITS is set to 4 with SETLOGO (which is the default), all images will automatically be saved as 16 colours graphics. Each colour of the image being saved will be changed to the closest colour in the standard 16 colour palette.

Bitmaps: the MAXBMPCOLOURBITS option for the SETLOGO command must be set to 4. Each colour in the bitmap being saved will be changed to the closest colour in the standard 16 colour palette.


Saving 16 Colours Graphics in ...

65536 colours without palette graphics mode:

Images: if MAXIMAGECOLOURBITS is set to 4 by SETLOGO (which is the default), all images will automatically be saved as 16 colours graphics. Each colour in the image being saved will be changed to the closest colour in the standard 16 colour palette.

Bitmaps: The MAXBMPCOLOURBITS option of the SETLOGO command must be set to 4. Each colour in the bitmap being saved will be changed to the closest colour in the standard 16 colour palette.


Saving 16 Colours Graphics in ...

16777216 colours (True Colour) graphics mode:

Images: if MAXIMAGECOLOURBITS is set to 4 by SETLOGO (which, however, is the default), all images will automatically be saved as 16 colours graphics. Each colour in the image being saved will be changed to the closest colour in the standard 16 colour palette.

Bitmaps: The MAXBMPCOLOURBITS option of the SETLOGO command must be set to 4. Each colour in the bitmap being saved will be changed to the closest colour in the standard 16 colour palette.


Saving 256 Colours Graphics in ...

standard VGA 16 colours graphics mode:

is not possible.


Saving 256 Colours Graphics in ...

256 colours with palette graphics mode:

Images: MAXIMAGECOLOURBITS option of the SETLOGO command must be set to 8 (otherwise, the image would be saved as 16 colour graphics). No colour changes are necessary.

Bitmaps: MAXBMPCOLOURBITS option of the SETLOGO command must not be set to 1 or 4. No colour changes are necessary.


Saving 256 Colours Graphics in ...

65536 colours without palette graphics mode:

Images: MAXIMAGECOLOURBITS option of the SETLOGO command must be set to 8 (otherwise, the image would be saved as 16 colours graphics

Bitmaps: MAXBMPCOLOURBITS option of the SETLOGO command must not be set to 1 or 4.

This process may take up to several minutes because a palette of 256 colours must be created by analysing each pixel of the graphics being saved (bitmap or image). This palette will always contain 16 colours from the standard palette plus up to 240 different colours encountered when analysing the graphics. All other colours of the graphics will be transformed into this palette.

The transformation process is shown by a special mouse cursor:


Saving 256 Colours Graphics in ...

16777216 colours (True Colour) graphics mode:

Images: MAXIMAGECOLOURBITS option of the SETLOGO command must be set to 8 (otherwise, the image would be saved as 16 colours graphics.

Bitmaps: MAXBMPCOLOURBITS option of the SETLOGO command must be set to 8.

This process may take up to several minutes because a palette of 256 colours must be created by analysing each pixel of the graphics being saved (bitmap or image). This palette will always contain 16 colours from the standard palette plus up to 240 different colours encountered when analysing the graphics. All other colours of the graphics will be transformed into this palette.

The transformation process is shown by a special mouse cursor:


Saving 16777216 Colours (True Colour) Graphics in ...

standard VGA 16 colours graphics mode:

is not possible.


Saving 16777216 Colours (True Colour) Graphics in ...

256 colours with palette graphics mode:

is not possible.


Saving 16777216 Colours (True Colour) Graphics in ...

65536 colours without palette graphics mode:

Images: MAXIMAGECOLOURBITS option of the SETLOGO command must be set to 24 (otherwise, the image would be saved as 16 colours graphics.

Bitmaps: MAXBMPCOLOURBITS option of the SETLOGO command must be set to 24 (which is the default).

When a bitmap or image saved in this way is loaded into another graphics mode, some colours may be slightly changed. Except in very special cases, this change is hardly noticeable to the SuperLogo user. However, some problems with FILL and DOTCOLOUR procedures may happen (DOTCOLOUR may, for example, output a different number than you will have expected in your Logo project).


Saving 16777216 Colours (True Colour) Graphics in ...

16777216 colours (True Colour) graphics mode:

Images: MAXIMAGECOLOURBITS option of the SETLOGO command must be set to 24 (otherwise, the image would be saved as 16 colours graphics.

Bitmaps: MAXBMPCOLOURBITS option of the SETLOGO command must be set to 24 (which is the default).

This process is done without any colour or palette changes.


Primitive Procedure - GETBOX
GETBOX   ---   operation with 1 input

GETBOX  [ ]

GETBOX  word

where

word is one of the following: SIZE, TITLE, BG, FRAME, FROM, PP, OFFSET, MARGIN, EDIT, ASIZE and MOUSE

If the input is the empty list, the operation outputs a list of all the settings of the first active text box turtle, even those settings that have their default values and were not modified by you:

? MAKETURTLE 1 [100 -100 0]
? ASK 1 [SETBOXMODE "TRUE SHOWTURTLE]
? MAKE 1 98765
? ASK 1 [SH GETBOX [ ]]
[PP 1 SIZE [0 0] TITLE 1 FRAME 1 BG 15 EDIT 1 OFFSET 0

MARGIN 0 FROM [0 0]]

If the input is any acceptable word, the operation outputs the setting corresponding to the specified keyword. Beside the 9 standard keywords (explained in the SETBOX topic) you can also make use of two more words. If the input to GETBOX is ASIZE, the operation will output the size of the text box, which may be different from SIZE if you have not specified SIZE at all and Logo decided the actual size. Another valid input to GETBOX is the word MOUSE. The output in this case is either an empty list [ ] or a list [C L], where C is the column and L the line co-ordinates of the character within the text box which has been clicked with the mouse. That is, if TOUCHED is not EMPTY?, you can find the line and column co-ordinates with ASK TOUCHED [GETBOX "MOUSE].

Note that neither ASIZE nor MOUSE can be used as valid inputs to SETBOX.

How a Text Box Turtle is Created...


See also related procedures...

SETBOX

SETBOXMODE

SETFRAMEMODE


Primitive Procedure - SETBOX
SETBOX   ---   command with one input

SETBOX  list

where

list is a list in the form [key.word1 value1 key.word2 value2 ... ], where each keyword is one of the following: SIZE, TITLE, BG, FRAME, FROM, PP, OFFSET, MARGIN or EDIT

There are several options that can be set for any text box: size, title bar, background colour, frame, range of the input (for numerical values), style, offset, margin, and editing allowed / disabled. Note that In SuperLogo, version 1.1 you cannot specify any text box settings through any shortcuts menu etc. The only way to do so is to use the Logo language primitive procedures.

SETBOX sets these options for all active turtles that are text boxes. Legal values for these keywords and their meanings are:

Setting the Size: To set the size of all active text box turtles, use SETBOX [SIZE [C L]], where the value [C L] is a list of two integers. The default setting is [ ] or [0 0] which means that Logo chooses the size for the text box according to the value of the corresponding input variable. (To learn how to find the actual size of the text box when no size has been specified, see GETBOX.)
If you set SIZE, both numbers must be integers bigger than -1. C specifies the number of columns of the text box and cannot be bigger than 80. L specifies the number of lines of the text box and cannot be bigger than 25.
If the text box is a slider, it always has either one line (horizontal slider) or one column (vertical slider). Therefore if you set the size of a slider, only the bigger number of C and L is accepted. It sets the horizontal size of the slider (if C  L) or the vertical size of the slider (if C < L).

Setting the Title Bar: The default value for the TITLE keyword is 1, which means that the corresponding text box (i.e. a window) has a title bar containing the name of a variable inside. If you set this keyword to 0, the title bar will not be displayed. Vertical sliders are always displayed without any title bar.

Setting the Background Colour: You set the background colour with SETBOX [BG colour] using one of the basic colours, or -1 to specify a transparent background. The default setting is 15 (for sliders the default is 7), that is, a white background. Note that if one or more text boxes with transparent backgrounds are present in the screen, Logo may be slowed down.

Setting the Frame of the Box: The default value for the FRAME keyword is 1, which means that the corresponding text box (i.e. a window) has a frame. If you set this keyword to 0, the frame will not be displayed. Note that this 'FRAME' is not anything to do with the 'frames' in images.

Setting the Range of a Variable: If you want to restrict all acceptable values of a variable X to be shown in the text box to a closed consecutive list [A, B] of integers, you can use SETBOX [FROM [A B]]. The default setting is [ ], or [0 0], which means that the values of X are unrestricted (even not restricted to numbers).
If you specify an interval with FROM [A B] (that is, A < B), both numbers A and B must be correct integers for Logo. Any attempt to assign a non correct value to the corresponding variable X (if X already exists) will result in making the value of X become A (the only exception to this rule is an attempt to assign an integer bigger than B. In this case B is assigned to the variable instead). If you first create a text box turtle, then specify its FROM [A B] and only then create its variable with an incorrect value, it will also result in assigning A:

? maketurtle "z [st]
? tell "z
? setboxmode "true
? setbox [from [1 100]]
? make "z "hello
? show :z
1

The set (interval) of acceptable values must contain at least two different numbers, that is, intervals of the type [A, A] are not legal for SETBOX [FROM ...].

Setting the Style (Pretty Printing): This option specifies the way in which the contents of the text box will be displayed. The value of the PP keyword can be any integer between 1 and 6, where 1 is the default. If the input is:

1 - the contents of the text box will be displayed in the same way as it is in the inspection window of the Memory Window,

2 - the contents of the text box will be displayed as if you used SHOW to display it in the text screen, but in one very long line,

3 - the contents of the text box will be displayed as if it were one long word in one line,

4 - the contents of the text box will be displayed as if it were printed onto the text screen with PRINTLINE. That is, if it is a list of lists, these inner lists will be printed as separate lines,

5 - the same as 4, however in this style you can specify the colour of the text inside the text box. If you insert into a line a list containing one integer between 0 and 15 - the number of one of the 16 basic colours, the text following this list will be displayed in the specified colour up to the end of the line or until it meets another colour specification,

6 - this value can be applied only if the value of the text box is an integer. The text box will be turned into the slider - displaying with its scroll box the actual value of the variable. For the slider the interval of acceptable values must be specified with the FROM keyword. If you do not specify any interval, the default setting [1 10] will be used. Depending on the SIZE keyword the slider can be either vertical or horizontal.

Setting the Offset: The value of the OFFSET keyword can be any integer between -999 and 999, the default setting is 1. If the value of the text box variable X is text of several lines (that is, if the PP of  turtle X is set to 1, 4 or 5), it may be that only a part of the text will be displayed in the text box. By specifying OFFSET you decide which part this will be.
If you specify OFFSET 1, the first line of the text will be displayed in the uppermost line of the text box. If you specify OFFSET 2, the second line of the actual text will be displayed in the uppermost line of the text box etc. If you specify OFFSET -1, the last line of the text will be displayed in the last line of the text box. If you specify OFFSET -2, the last but one line of the actual text will be displayed in the lowermost line of the text box etc. The OFFSET option only works if  the text itself is larger than the text box can display.

Setting the Margin: The value of the MARGIN keyword can be any integer between -99 and 99, the default setting is 0. If you specify MARGIN 1, first column of the text box will be empty and all text will be shifted one character to the right. If you use any other positive number, the whole text will be shifted to the right by that number of columns. If you specify a negative number, the whole text will be shifted to the left by the corresponding number of columns.

Setting the Editing: The value for the EDIT keyword can be 0 or 1, the default is 1 (for sliders, however, the default is 0). If you have a text box turtle X and specify EDIT 1 for it (or if you do not specify anything at all), it will be possible to edit, that is to change the contents of the text box either by:

  double clicking it at any time - even if an instruction is running. In this case READKEY will output -3 (ONLY if the contents of the text box has been modified), TOUCHED will output the name of the corresponding turtle-variable and MOUSE will output the actual position of the text box. READKEY will output -3 even if you drag the scroll box of the slider,

  using EDIT ":X - even if an instruction is actually running.

If you specify SETBOX [EDIT 0], editing of the contents of the text box will be disabled.


See also related procedures...

GETBOX

SETBOXMODE

SETFRAMEMODE


Primitive Procedure - SETBOXMODE
SETBOXMODE   ---   command with 1 input

SETBOXMODE logical

If the input is TRUE, this command will make all active turtles become text boxes.

If the input is FALSE, all active turtles will be turned back into ordinary turtles. Other variables are not modified in any way by this change, however, they are not shown on the screen in the text boxes any longer. The turtles' shapes are replaced by the default shape (the triangle).

How a Text Box Turtle is Created...


See also related procedures...

GETBOX

SETBOX

SETFRAMEMODE


Basic Definitions - Text Box Turtle...
Text Box Turtle ...

is a turtle that shows the value of a variable with the same name in the graphics screen. It usually looks like a Memory Window inspection window  with a textual value displayed inside. It may also be a horizontal or vertical slider. Its hot spot, that is the position of the corresponding turtle, is the position of its upper left corner.

If you create a text box turtle X to show  variable X and the variable does not exist, the turtles shape will be an empty image - until variable X is created by Logo primitives MAKE, NAME, LET or LOCAL or as the name of an input to a procedure. When variable X is erased or if it is a local variable  and the procedure ends, the corresponding text box turtles shape becomes an empty image. If there is both a global variable and a local variable with the same name at any time, the most recent value is shown.

Any time the variables value has been modified, the contents of its text box in the screen is automatically updated to display the most recent value. Such modifications are possible either from the command line (if no instructions are running) with the MAKE or NAME primitives, from a running program with MAKE, NAME or LET, from a running program by calling a procedure, by turning the text box into the Text Box Editor (if a program is running or not) and editing the value of a variable, or by moving the slider - if the corresponding text box turtle has a slider (if a program is running or not).

How a Text Box Turtle is Created...

Text Box Editor


How a text box is created...
How a Text Box Turtle is Created ...

There are two ways to create a text box turtle:

Either you create a turtle using MAKETURTLE and later declare it to be a text box by using SETBOXMODE "TRUE. This turtle will have all the options of any turtle - a pen with a colour, width, pattern, its home position etc. Its shape will be the corresponding text box (if the variable of the same name already exists) or an empty image. All turtle commands are valid and accepted for this turtle except SETSHAPE. If the corresponding text box is bigger than 255 x 255 points, GETSHAPE will output only its upper left section in the size 255 x 255. Note that SETSHAPECOLOUR, SHAPECOLOUR and SETPENCOLOUR can be used to modify the colours of the text box.

If X is a text box turtle and you use ASK "X [SETBOXMODE "FALSE], you turn X back into a normal turtle. Variable X is not modified in any way by this change, but it no longer appears on the screen. The turtles shape is replaced by the default shape (the triangle).

You can also create a text box turtle X by creating the variable X first - for example by using MAKE "X 1000. Then you open the Memory Window. There you can select the variable, press the Shift key and drag it with the right mouse button out of the window. You can do this by dragging the name of the variable from the list of user-defined objects or by dragging the inspection window from the inspection area of the window. If the variables value is an image, it cannot be dragged out of the Memory Window. When you release the right mouse button and the Shift key, a new turtle named X is created and automatically becomes a text box turtle with all default settings.


Text Box Editor ...

is a simple text editor with no menu commands and no right click shortcuts. It allows you to modify the contents of the text box with standard editing. You can use drag-and-drop and also standard Cut, Copy, Paste and Undo keyboard shortcuts Ctrl+X, Ctrl+C, Ctrl+V and Ctrl+Z. All square brackets and all Enter characters in the contents of the text box are printed with the PP setting. The Text Box Editor can be closed by pressing:

Esc key, however, in this case the most recent editing is not accepted and the changes are ignored,

F12 or Alt+F4 or the minimise button located in the text boxs title bar. In this case all changes are accepted. The contents of the corresponding inspection window in the Memory is also updated,

Enter, if the PP option of the text box is set to 3 or 6. In this case all changes are accepted. The contents of the corresponding inspection window in the Memory is also updated.


Basic Definitions - Slider Text Box...
Slider Text Box ...

is a text box with the PP attribute set to 6. Each slider must have its own range of values set. You can move the sliders scroll box either by dragging it or by clicking on the scroll bar. In this case the READKEY operation outputs -3 (to show that the sliders value has been modified). If you use SETBOX to set SETBOX [EDIT 1], it is also possible to double click the slider scroll box (or its title line) and thus open the Text Box Editor. The default orientation is horizontal, the default size being [19 1]. The minimum possible size for a horizontal slider is [4 1], for a vertical slider [1 2]. A vertical slider never has a title bar.


; CREATING TEXT BOXES

; Procedures SETBOX, SETBOXMODE and GETBOX

;

; The first sequence of instructions will create a transparent

; one-line text box. The second sequence will create a text box

; named B. It will be a text box of 10 columns and several

; lines - depending on the actual contents of the corresponding

; variable. This number can never exceed 25. The third

; sequence will create a text box named C which will show

; a column of numbers from 1 to 100. The column of numbers

; will scroll upwards on its own within the box C.

;

? MAKE "A [Hello my dear]
? SETBG 7
? MAKETURTLE "A [-100 100 ST]
? TELL "A
? SETBOXMODE "TRUE
? SETBOX [PP 3 BG -1 FRAME 0 TITLE 0]

? MAKE "B GENERATE 10 [WORD :% :%] "A
? MAKETURTLE "B [-100 50 ST]
? TELL "B
? SETBOXMODE "TRUE
? SETBOX [PP 4 SIZE [10 0]]

? MAKE "C GENERATE 100 [:% + 1] 1
? MAKETURTLE "C [25 200 ST]
? TELL "C
? SETBOXMODE "TRUE
? SETBOX [PP 4 SIZE [5 20]]
? REPEAT 81 [SETBOX SE "OFFSET REPC]


Reading From and Printing Into the Text Box

By using READFROM it is possible to redirect the standard input stream not to come from the keyboard or a file, but to come from a text box. It is also possible to redirect the standard output stream not to go into the text screen or into a file, but to go into a text box with the PRINTTO command.

If you want to print into the text box named X (and the text box turtle X plus the corresponding variable already exist), you can use PRINTTO ":X. This command will automatically modify the text box by doing ASK "X [SETBOX [OFFSET -1 PP 4]]. From now on all PRINT, PRINTLINE, SHOW and TYPE commands will output into the text box X - adding lines or characters to the end of the actual contents of the text box. At the same time the value of variable X will immediately be up-dated. If no special size for the text box is fixed with the SIZE keyword, the number of lines in the box will grow with each new line being printed into X (not exceeding 25). To close the current output stream and redirect it back to the text screen, you have to use PRINTTO [ ].

By using READFROM ":X you redirect the standard input stream to come from the specified text box. If the text box (either the turtle or the variable) doesnt exist, the first attempt to read from it with READLIST, READWORD or READCHAR will redirect the input stream to come from the keyboard - as if the READFROM [ ] instruction was typed in. The output of the operation will be an empty list (for READLIST and READWORD) or a space (for READCHAR). If the text box already exists, all following READLIST, READWORD and READCHAR operations will read lists (lines), words and characters from the text box in a similar way as from a file. READCHAR, however, will read only the first character of a word and then move the reading point to the next word. When the whole contents of the text box is read through, the EOF? operation will output TRUE - however, READFROM [ ] is not set automatically.

Reading from a text box is nearly identical to reading from a file. However, you must be very careful with the small differences.


  Text Box Turtles

In SuperLogo there are three types of turtles:

a normal turtle that has a shape (i.e. an image) and makes use of its frames to show its heading,

an animation turtle that has a shape (an image) but makes use of its frames independently of the heading, and

a text box turtle that - through its shape - shows the value of a variable with the same name.

  SETBOXMODE	- sets a turtle to be a text box,

  SETBOX	- specifies settings for a text box turtle,

  GETBOX	- outputs all the settings of a text box turtle

For more details about text box turtles see also:

How a Text Box Turtle is Created

Text Box Editor

Slider Text Box

Reading From and Printing Into the Text Box


Creating Text Box Turtles...
  Creating Text Box Turtles in the Memory Window

You can create the text box turtle X by creating the variable X first - for example by typing MAKE "X 1000 or by using the Add Variable... command in the Objects Menu in the Memory Window. There you can select the variable, press the Shift key and drag it with the right mouse button out of the window. You can do this by dragging the name of the variable from the List of user-defined objects or by dragging the inspection window from the Inspection area of the window. If the variables value is an image, it cannot be dragged out of the Memory Window - it cannot be turned into the text box. When you release the right mouse button and the Shift key, a new turtle named X is created and automatically declared to be the text box turtle with all default settings.