.. highlightlang:: us
.. index:: View=>Command Window
.. index:: y^view-command-window
.. _viewcommand-window:
.. _view-command-window:
View=>Command Window
--------------------
This command opens the UniScript command window. In this window, you can carry
out calculations and run UniScript functions.
UniScript Commands
^^^^^^^^^^^^^^^^^^
The command window can be used to run a UniScript function::
m = matlab_load(GetRootDirectory() + "samples/map-data.mat");
To print the value of a variable type in the variable name and press enter::
m
[.
BEEWG = matrix 1 x 78 [1002.5, 461.7, 350.3, 322, 302.6, ...]
CO = matrix 1 x 78 [0.6, 0.08, 0, 0.05, 0.05, ...]
EWGLST = matrix 1 x 78 [1, 3.1, 5.2, 7.3, 9.4, ...]
_ = string-matrix 11 x 1 ["N", ...]
...
]
object (obj at 0x51DC554)
* m.BEEWG
1002.5000 461.7000 350.3000 322.0000 302.6000 319.9000 ...
Multiple functions must be separated by a semi-colon::
x = linspace(0, 2*PI, 100); y = sin(x); plot(x, y);
The output can be copied into the clipboard or can be displayed in an editor
using the dot command ``.clip``.
.. _dot-commands:
Dot Commands
^^^^^^^^^^^^
UniPlot R2010 supports dot commands.
.. note::
Dot commands can only be used at the UniScript command prompt, not in programs.
Dot commands start with a dot. The command can be abbreviated, for example
instead of ``.help`` you can type in ``.h`` If the abbreviation is ambiguous
a list with all matching commands will be displayed.
.. list-table::
:header-rows: 0
* - ``.cd``
- Change directory.
* - ``.clear``
- Clears the command window.
* - ``.clipboard``
- Opens an editor with the clipboard content.
* - ``.cmd``
- Executes a DOS command. Example: ``.cmd del uniplot.tmp``.
* - ``.dir``
- Lists a directory. Example: ``.dir d:\ /os``
* - ``.edit``
- The .edit command opens a UniScript function in an editor. Example: ``.edit EdCreate``
* - ``.explorer``
- Opens the Windows-Explorer. Example: ``.ex c:\``
* - ``.help``
- Opens a help topic. Example: ``.help sin``.
* - ``.lua``
- Starts :ref:`lua`.
* - ``.quit``
- Quit UniPlot.
* - ``.show``
- Lists all handles of documents, datasets, drawing objects, etc.
* - ``.system``
- Runs a program. Example: ``.sys notepad d:\a.txt``.
* - ``.version``
- Returns the UniPlot version string.
* - ``.what``
- Lists UniScript function names. Example: ``.what *sin*``
``.cd`` - change directory. The argument can be a drive or a folder. Entered
without an argument the command returns the current path name.
::
* .cd
d:\uniplot-build\main
* .cd d:
D:\uniplot-build
* .cd d:\
d:\
``.clipboard`` - If the clipboard contains text the command opens the text in a
UniPlot-Editor. Example: ``.clip``
``.cmd`` - Executes a DOS command. Example: ``.cmd del uniplot.tmp``.
``.dir`` - Displays a list of files and subdirectories in a directory
(see also ``.cd``).
::
* .cd c:\uniplot
c:\uniplot
* .d
Volume in drive C has no label.
Volume Serial Number is 8834-48FF
Directory of c:\uniplot
31.05.2009 13:24
.
31.05.2009 13:24 ..
11.05.2009 09:46 addin
11.05.2009 09:46 autoload
11.05.2009 09:46 bitmap
11.05.2009 09:46 Formula
24.07.2009 11:34 help
17.06.2009 12:32 Program
11.05.2009 09:46 samples
11.05.2009 09:46 script
11.05.2009 09:46 startup
22.06.2009 11:39 template
06.07.2009 15:35 54.525 Uninstall.exe
1 File(s) 54.607 bytes
12 Dir(s) 25.147.686.912 bytes free
*
``.edit`` - Opens a UniScript function in an editor. Example:
``.edit sinh`` opens the file containing the :ref:`sinh` function.
``.explorer`` - Starts the Windows-Explorer. Example: ``.ex c:\``.
``.help`` - displays this page or another help topic.
Example: ``.help sin``. To open a help topic it is easier to place the cursor
in the function name and press **F1**.
``.lua`` - Starts :ref:`lua`. ``exit`` to return to UniScript.
Example::
* .lua
LuaJIT 2.1.0-beta1 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
JIT: OFF SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
UniPlot Lua interface v1.0 - Copyright (c) 2015 FEV Software and Testing Solutions GmbH (http://www.uniplot.com)
Type 'exit' to return to UniScript
> a = rand(3,3)
> a
3x3
0.147248 0.0529661 0.607899
0.763069 0.146725 0.98715
0.261875 0.252775 0.872349
> exit
``.quit`` - Quits UniPlot.
``.show`` - Displays the handle values of all open documents, drawing objects
datasets, etc.
``.system`` - Runs a program. Example: ``.sys notepad d:\a.txt``.
``.version`` - Returns the UniPlot version string.
.. highlightlang:: none
::
* .v
5.20.0 Date: Jan 23 2010 (x64)
.. highlightlang:: us
The dot-commands are written in UniScript. See
:file:`script\\uniscript\\dot-cmds.ic`. Example command ``.clipboard``:
::
def _cmd_clipboard(s)
{
if (IsTextInClipboard()) {
sClip = GetClipboardText();
hEd = EdCreate();
EdSetText(hEd, sClip);
} else {
print "no text in clipboard";
}
}
The command starts with ``_cmd_`` and has one string parameter. The parameter is
the text entered with the command.
Keyboard
^^^^^^^^
To edit a command line, the following keys are supported:
.. us.dlgitem
**Ins**
The Insert key switches between type over and insert mode.
.. us.dlgitem
**DEL**
Deletes the character following the cursor position.
.. us.dlgitem
**Backspace**
.. us.dlgitem
**Arrow right, Arrow left**
Moves the cursor one character to the right or the left.
.. us.dlgitem
**Enter**
Executes the command line.
Executes the complete command no matter where the cursor in in the line.
.. us.dlgitem
**Arrow up, Arrow down**
Toggles through the command history (last commands).
.. us.dlgitem
**F1**
If the cursor is located a function name and F1 is pressed the help text for
that function will be displayed.
.. us.dlgitem
**F7**
Displays the command history list box. The :kbd:`Enter` key copies the
selected line into the command window.
.. image:: S:/uniplot-obj/images/ViewCommandWindow-en.*
.. us.dlgitem
**F8**
Searches for an item in the command history. If the command line is empty, all
other entries will be shown one after the other. If a command appears, only
commands that start with the same characters will be shown.
.. us.dlgitem
**ESC**
Deletes the command line.
1.) Aborts the current UniScript task. 2.) If the UniScript interpreter is
idle the key clears the command line.
.. us.dlgitem
**Ctrl+C**
1.) Aborts the current UniScript task. 2.) If the UniScript interpreter is
idle: Copies the line containing the cursor to the clipboard.
.. us.dlgitem
**Ctrl+V**
Inserts a text line from the clipboard to the command line.
.. us.dlgitem
**Shift+Insert**
Copies the current line into the clipboard.
.. us.dlgitem
**Ctrl+Alt+C**
Copies the complete contents of the command window into the clipboard.
**Ctrl+D**
Removes the displayed command from the command history.
.. seealso::
:ref:`view`
:sub:`id-1230994`