BFOIT - Introduction to Computer Programming

Appendix B (Directives)

TG Programming Environment Directives

Certain commands entered in the CommandCenter window help with the program development process.  These commands are not part of the jLogo language = they can't be included in procedures you define.  Examples of directives: there is a directive which prints the title lines of all of the procedures you've defined; there is a directive which prints a textual representation of a procedure you specify.  In summary, directives help you write and debug programs.

Program Management (Directives)
Name Input(s) Description Example
BYE   Close the TG programming environment.  
 [Ctrl]-t   While in the CommandCenter, holding down the [Ctrl] key and pressing the "T" key will print the name of the current turtle and the state of all turtles.  
 [Ctrl]-q   While in the CommandCenter, holding down the [Ctrl] key and pressing the "Q" key will stop program execution - think of Ctrl-Q as a QUIT directive.  
 CLEARTEXT
 CT
  Erases all of the text in the CommandCenter.  CLEARTEXT
 END   Completes the definition of a procedure.  
 NEWTURTLE   name Creates a new turtle with the specified name.  NEWTURTLE "t2
 PRINTPROCS
 PP
  Displays the names and inputs of all procedures that have been defined in the current session in the CommandCenter.  PRINTPROCS
PRINTSTACK
PS
Prints the procedure invocation stack collected upon last runtime error.
 PRINTTEXT
 PT
 name Displays the source code representation of the procedure named name in the CommandCenter. PRINTTEXT main
 TALKTO  name Directs future CommandCenter input to the specified turtle, i.e., makes name the current turtle.  TALKTO "t2
 TO  :input1
 :input2
 ...
Initiates definition of a procedure. It will be named procname. Inputs, which are optional, are given the names input1, input2, etc. All names are case-insensitive. TO box :size
 TRACE  procName
 varName
Directs TG to display information every time a specified user-defined procedure is invoked or a specified global variable's value is changed. TRACE keyPressed
TRACE curNum
 UNTRACE  name Cancels the TRACE request for the named procedure or global variable. UNTRACE keyPressed
UNTRACE curNum


Back to Jargon
Go to the Table of Contents
On to jLogo Primitives