BFOIT - Introduction to Computer Programming

Appendix C (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 in the program you are currently working on,
  • there is a directive that makes the turtle slow down, taking a rest after every graphics operation it performs (useful for debugging).
  • there is a directive which lets you insert the contents of a file into the editor at the current cursor location.

In summary, directives help you write and debug programs.

*NOTE* With the exception of TO and END, directives should only be entered in the CommandCenter.  And... directives can only be entered one at a time, on lines by themselves.  You can't enter multiple directives on a single line of input; all those after the first on a line are ignored.

Program Management (Directives)
Name Input(s) Description
 [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.
 [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.
 AUDIOFILES    Prints the names of all of the audio files in the current directory which can be imported with the LOADCLIP command.
BYE   Close the TG programming environment.
 CD   path Change the current directory based on path. Path can be either an absolute (full) directory specification or one relative to the current directory, i.e. a parent or subdirectory specification.
 DIR
 LS 
 pattern  Prints the names of files in the current directory. Without a pattern input, all file names are printed. With a pattern input, all files that have names which match the pattern are printed. Patterns can consist of characters and the wildcard '*' (matching any number of any characters).
 EDIT
 EDITOR 
 word  If no editor window is open in TG, open one. Transfer keyboard focus to the editor window, optionally loading a file named word.
 EMACS    Set the editing mode to Emacs. In Emacs mode, the Editor's commands are a subset of the GNU Emacs program. The set of commands is documented in Appendix E .
 END   Completes the definition of a procedure.
 HELP   xxx  "HELP" by itself prints a usage message which is an overview of to use the service. "HELP" with an input prints information about the input.  An input can be a category name, a built-in Logo procedure name, or a common keyword.
 JLOGOFILES    Prints the names of all of the files in the current directory which have a names ending in ".jogo"
 LOADCODE   word Reads the file named word, placing its contents in the Editor. The text is placed at the current location of the cursor.
 PICTFILES   Prints the names of all of the picture files in the current directory which can be imported with the LOADPICTURE or LOADSHAPE commands.
 PRINTGLOBALS
 PG
  Prints all of the current global variables and their contents.
 PRINTPROCS
 PP
  Displays the names and inputs of all procedures that have been defined in the current session in the CommandCenter.
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.
 PWD   Prints the working directory - the current directory that files are read from or written into.
 TALKTO  name Directs future CommandCenter input to the specified turtle, i.e., makes name the current turtle.
 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.
 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.
 UNTRACE  name Cancels the TRACE request for the named procedure or global variable.
 VERSION   Prints the version numbers of the TG programming environment, the Java Virtual Machine, and the operating system.
 WINEDIT   Set the editing mode to WinEdit. In WinEdit mode, the Editor's commands are similar to the Microsoft Windows Notepad program. The set of commands is documented in Appendix E .


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

Public Domain Mark
This work (BFOIT: Introduction to Computer Programming, by Guy M. Haas),
identified by Berkeley Foundation for Opportunities in IT (BFOIT),
is free of known copyright restrictions.