Prev Next

JavaScript Console

The JavaScript console is a command line interpreter that accepts single line JavaScript commands that will be executed one at a time. You type the commands into the bottom text entry panel and, when you press the Enter key to execute the command, it is added to the upper, output window with any output from the command.

A command line interface for Javascript consoles

This feature is available in the Corporate, Unified and Ultimate editions of Enterprise Architect.

Access

Ribbon

Specialize > Tools > JavaScript

Simulate > Console > JavaScript

Console Commands

Console commands are preceded by the ! character and instruct the console to perform an action.

The available console commands include:

  • !clear - clears the console display
  • !save - saves the console display to a file
  • !help - prints a list of commands
  • !close - closes the console
  • !include <scriptname> - executes the named script item; scriptname is of the format GroupName.ScriptName (spaces are allowed in names)
  • ? -  lists commands (same as !help)
  • ? <variable or function name> - outputs the value.

To list these commands on the 'Console' tab itself, type ? in the lower panel (without the preceding ! character) and press the Enter key.

If you intend to execute scripts, you might want to have the Script Library (Scripting window) open as well, so that you can see the scripts available to call. Select the 'Specialize > Tools > Script Library' ribbon option.

Videos

Sparx Systems provide a YouTube video of using the JavaScript Console to create a JavaScript Solver. See:

     Matlab and Simulink Integration in Enterprise Architect 15.2: Part 1 JavaScript Solver