jj logo
Take a quick tour of JJ
Teacher Registration
Student Registration
Industry Registration
Guest Registration
Some Humor
Friends
Quotes


Name
Password
School


..
JJ Commands

Welcome to the JJ commands page. This page introduces you the commands used in JJ.

Each JJ command starts with a JJ command word. JJ command words all start with a capital letter. So, if you are starting an command, remember that the first word always starts with a capital letter.

COMMANDS, COMMENTS, BLANK LINES

JJ allows commands to be combined with comments and blank lines. (Comments and blank lines are allowed for better description and readability of your JJ code.)
Every line is either a command, a comment or a blank line.

Comments

Comments start with '--' and are followed with commentary for anybody that may be reading your JJ commands. For example:
 -- This is a comment.  Notice that it starts with '--'
Comments are also allowed at the end of a command. For example:
    Box rate ofType int  --hourly rate

Blank lines

Blank lines are used as a visual aid for your reader. For example, take a look at a list of Box commands written with and without a blank line:
    Box studentName ofClass Str
    Box studentID ofType int
    Box studentAddress ofClass Str
    Box teacherName ofClass Str
    Box teacherOffice ofClass Str
    Box teacherOfficeHours ofClass Str

             -- now, with a blank line as a separator

    Box studentName ofClass Str
    Box studentID ofType int
    Box studentAddress ofClass Str

    Box teacherName ofClass Str
    Box teacherOffice ofClass Str
    Box teacherOfficeHours ofClass Str

             -- A blank line helped in the above example, but consider
             --  a different style and decide for yourself if a blank
             --   line would help readability.

    Box studentName        ofClass Str
    Box studentID          ofType  int
    Box studentAddress     ofClass Str
    Box teacherName        ofClass Str
    Box teacherOffice      ofClass Str
    Box teacherOfficeHours ofClass Str

Commands

Command introduction

When you first begin using JJ you are likely writing small programs, consisting of about a dozen commands. When you are writing small programs, your first command can be: Box, Boxes, Output, Outputln, If or Repeat. Once you start writing larger programs, your first command will always be the Import command, and your program will always have a Class and an EndClass command.

Commands by Categories

DECLARE YOUR BOXES BEFORE ANY ACTION COMMANDS

  • Box
  • Boxes

ACTION COMMANDS

ACTION: ASSIGNMENT

  • Set
  • Inc
  • Dec

ACTION: INPUT/OUTPUT

  • Input
  • Output
  • Outputln

ACTION: CHOICE

  • If
  • ElseIf
  • Else
  • EndIf

ACTION: LOOPING

  • Repeat
  • ExitOn
  • EndRepeat

Commands by Alphabetized List

Here is an alphabetized list of commands you can use when you are first beginning and do not have any Import, Class or EndClass commands in your program: (Click on a word to jump down to a description of the rules for that command.)

Command Rules

Here is an overview of the rules for commands you can use when you are first beginning and do not have any Import, Class or EndClass commands in your program:
Return to
    JJ
home page
..