Outputs a string to the specified device.
type option string
Escape Sequence | Description |
---|---|
\n |
New line |
\r |
Return |
\d |
Delete |
\t |
Tab |
\u |
Convert number to Unicode Char |
\xhh |
ASCII character; hh are hex digits |
For example:
// Note: ASCII character 61 (hexadecimal 3D) is the equal sign. // Output to a pop-up attention window the text "Test A" // then on a new line type "Test B = Test C": type -b "Test A \n Test B \x3d Test C";
type "\u2554====\u2557";//╔======╗
// Output to a pop-up attention window the text in ''BadCalculation'', // in the '''General''' section of the ORIGIN.OMG file. Type -b $General.BadCalculation;
Syntax: type string
Print string to the Script window.
Syntax: type ogsFileName
Running and Debugging LabTalk Scripts: Debugging Tools.
Syntax: type -a string
Open the Script Window (if it is hidden or closed) and print string.
Syntax: type -b string
If the string is omitted, this command produces a beep.
Syntax: type -c string
Syntax: type -gb[e][f][n|r] filename
Send all subsequent type command strings to a file. End writing to file with type -ge.
If neither n nor r is specified then output CRLF for end-of-line. Use type -l <text> to output with no end-of-line.
type -gb %Yjunk.txt; type "some thing1"; type "some thing2"; type "some thing3"; type -ge;
Syntax: type -ge
End writing to a text file. Used after type -gb.
//store some information to the active page storage area and type the tree to a file page.tree.experiment.sample.RunNumber = 45; page.tree.experiment.sample.Temperature = 273.8; type -gbef %Yjunk3.txt; page.tree.=; type -ge;
Syntax: type -h
Hide the Script Window
Syntax: type -html "html str"
Create a dialog based on the html code.
type -html "file://Table.html"; // Execute the Table.html file, which is located in the User Files Folder type -html "http://www.originlab.com"; // Open the website in a dialog type -html "<button>Click</button>"; // Execute html command line to create an HTML button
Syntax: type -l string
Print to the Script Window, but disable the carriage return and linefeed for this text
Syntax: type -latex string
create LaTeX object
type -latex "y=3+\frac{2}{0.2\sqrt{\pi/2}}e^{-2\frac{(x-1)^2}{0.2^2}}"
Syntax: type -mb n
Syntax: type -me
Syntax: type -mg stringoridofentry VarName
Syntax: type -ms stringoridofentry Value
Syntax: type -n string
Syntax: type -o argument
Argument can be one of the following (you need only supply the first letter):
execute | Turn Script Execution off. There is no script command to restore execution. User must select Edit : Script Execution in the Script window menu. |
new | Clears the contents of the Script window. |
open [filename] | Print the filename contents to the Script window. If filename is not specified, open the Open dialog box. Subsequent use of the File : Save menu option of the Script window or type -o save will write to this file until File : New is selected or type -o new is executed. |
Print the contents of the Script window to the current Windows default printer. | |
save [filename] | Save the current Script window contents. If the open option was previously used and no filename is specified, then that file will be overwritten. |
tab pixels | Set the tab spacing to pixels pixels. The default value is 45 pixels. All tabs in the Script window will update immediately. |
window title | Change the title of the Script window to title. The change persists even if the Script window is hidden. Closing the Script window clears the change. |
Syntax:type -q string
-qp n | Enable or disable the arithmetic status messages that show the progress of calculations. n = 1 (enable) or (disable) n = 0. |
-qs n | Enable or disable the status bar. Enable (n = 1) or disable (n = 0) the status bar. When the status bar is disabled, the last message displays until the status bar is enabled again. |
Syntax:type -s string
Unlike the -a option, this command will not open a hidden Script window and it will do nothing if the Script window is closed.
Syntax: type -tb object.property
Syntax: type -tn object.property
Syntax: type -tq object.property
Syntax: type -ty object.property
Syntax: type -v -option message
Syntax: type -y string
The following script displays the message "I'm busy right now" in the status bar.
type -q "I'm busy right now";
The next script displays the message "Here is some text, and here is some more" on one line in the Script window.
type -l "Here is some text"; // other code type ", and here is some more";
The next two scripts illustrate use of the type -mb
and type -me
commands. In this example, you Append a project. Normally, a dialog opens that asks whether to Append to the current folder or to create a new folder. Such messages would normally stop a script until you responded to the message. With the type -mb
command, you can override the dialog box.
// Begin override of messages, using a response of No/Cancel //- Do not create a folder type -mb 0; doc -a D:\SAMPLE.OPJ; // Append an OPJ // End override of messages type -me; // Begin override of messages, using a response of Yes - Create a new folder type -mb 1; doc -a D:\SAMPLE.OPJ; // Append an OPJ // End override of messages type -me;
The next script prints "My file is stored in c:\temp\file1.opj." to the Script window.
Note: \t is not interpreted as a tab due to the use of the -v option. Remove the -v and try again to see the effect.
type -v "My file is stored in C:\temp\file1.opj.";
The last script displays the Bottom X Axis Title text from the active graph window in a dialog box with an OK button.
type -tb "XB.text";
Type, $() Substitution and its C formatting
Note: You can use Print (command) to print the output text in the Notes window.