Watson Imperative Programming Tutorial


Home
Labs
Tutorials
Known Bugs
Schedule
Archive
Members
Contact Information

Statements

Below is a screenshot from the edit code window which shows a popup menu that is displayed when the keyword "statements" is clicked. This allows you to perform certain actions (those at the top of the popup menu) or insert other commands (those at the bottom of the menu). Following the graphic is a detailed list of the available commands along with a description of what each does.

  • Insert After Highlighted Text - Inserts a new statement line after the current line of code.
  • Insert Before Highlighted Text - Inserts a new statement line before the current line of code.
  • Delete Highlighted Text - Delete the current statement line.

  • Undo Last Action - Undoes the last change made to the code.

  • Cut - Deletes the highlighted code and places it in the clipboard.
  • Copy - Places a copy of the highlighted code into the clipboard.
  • Replace - Replaces the highlighted code with the contents of the clipboard, as long as the formats are the same.
  • Expand - Inserts the default constructs into an area where they have been inadvertently deleted (i.e. if you accidentally delete all of the declarations of a program, simply click expand).

  • Write - Writes some text to the output area.
  • WriteLn - Writes a line of text to the output area, and goes to the next line.
  • Read - Pops up an input box, and assigns the input to the specified variable.
  • Assignment- Integer Variables - Assign the value of an expression to an integer variable.
  • Assignment- String Variables - Assign the value of an expression to a string variable.
  • Assignment- Integer Array Element - Assign the value of an expression to an integer array element.
  • Assignment- String Array Element - Assign the value of an expression to a string array element.
  • If-Then - Checks a condition, and if it is true, execute the code specified by the 'Then' argument.
  • If-Then-Else - Similar to If-Then construct, but additionally provides what code to execute (with the 'Else' argument) if the condition is not true.
  • For Loop - Loops for a specified number of iterations.
  • While Loop - Loops as long as a condition holds true.
  • Procedure Call - Calls a procedure or function.

<< Back

Back to Tutorials



Home | Labs | Tutorials | Known Bugs | Schedule | Archive | Members | Contact Information

For problems or questions regarding this site or the labs, contact the Watson Project.
Last updated: 10/22/03.