LOGO Primitives

 

Command

Short Form

Example

Description

Chapters 4 – 8   Procedures

;

;

;

; Tells LOGO that everything on that line is a comment.  The Interpreter ignores anything on that line.

PRINT

PR

PR “Hello

Prints one word in the listener window.

 

 

PR [Hello World!]

Prints a list enclosed in [ ] in the listener window.  For now consider a list in this example as a sentence.

TO

TO

TO SQUARE

Creates a procedure using the name listed following the word TO. 

:

:

:LEN_SIDE

: is used immediately before a local variable name in a procedure.

TURTLETEXT

TT

TT [Hello World!]

Stamps the input word or list at the active turtle’s position in the current pen color and font, when the pen is down.

SETFONT

SETFONT

SETFONT “times 14 1

SETFONT defines the turtle font. The first input is the font name. The second input is the font size, given in points, while the third is a combination of the following attributes:

0   regular
1   bold
2   italic

4   underlined

POTS

POTS

POTS

Displays a list of the procedure titles currently in the workspace.

POPS

POPS

POPS

Displays all user-defined procedures and their definitions currently in the workspace.

PO ALL

PO ALL

PO ALL

Displays everything in the workspace.

ERASE

ER

ER SQUARE

Erases one procedure from the workspace.  In the example SQUARE is erased from the workspace.

 

 

ER TRIANGLE SQUARE PENTAGON HEXAGON

Erases all of the procedures listed after the ER command.  Each procedure is separated by a space from the other procedures.

ERASE ALL

ER ALL

ER ALL

Erases all procedures currently in the workspace.

PAUSE

PAUSE

PAUSE

Used to “debug” your program.  This command will cause the program to stop execution and allow you to “Step” through your program using the Stop Light to trace your program commands.

EDIT

ED

ED SQUARE

Opens the named procedure in the Editor window

EDIT ALL

ED ALL

ED ALL

Opens all of the procedures, all the variables, and all of the contents of the workspace in the Editor Window

LOADPIC

LOADPIC filename.ext 

LOADPIC “Harry.bmp

LOADPIC loads the picture file from the disk to the graphics screen. The file is loaded as a bit map which fills the graphics window.

IF THEN

IF THEN

IF :X > 100 THEN STOP

Tests whether the conditional statement (placed between the IF and the THEN) is true or false.  If it is true the command after THEN is executed.  If false, LOGO continues with the next command line in the procedure.

STOP

STOP

STOP

Causes the current procedure to stop executing and return control to the calling procedure.

TOPLEVEL

TOPLEVEL

TOPLEVEL

Stops the current procedure and all calling procedures, and returns control to the user.