LabTalk Object Type:
The type object provides output control to the Script Window, Results Log, Command Window, Messages Log, status bar, and notes window.
Property | Access | Description |
---|---|---|
type.notes$ | Read/write, string |
When outputting with the type.wks() method, this property contains the name of the notes window that will receive the output if specified by type.redirection. |
type.notesRemainIcon | Read/write, numeric |
When outputting with the type.wks() method, if the notes window specified in type.notes$ is minimized before output, then this property determines whether or not it remains minimized after output. |
type.notesState | Read only, numeric |
Get the state of the notes window specified by type.notes. The return value is bit oriented. |
type.numCols | Read/write, numeric |
The number of columns in the current output window as determined by type.redirection. After executing the type.wks(wksName) method, if the actual number of worksheet columns exceeds the value specified by numCols, then subsequent columns display below the first set of columns in the output window. |
type.redirection | Read/write, numeric |
Set the current output window. |
type.repeatCol | Read/write, numeric |
If the number of columns in a worksheet exceeds the number of columns in the current output window as specified by type.numCols, then this property controls whether or not the first worksheet column is repeated for each block when outputting with the type.wks(wksName) method. |
type.state | Read only, numeric |
Get the state of the Script window. The return value is bit oriented (see type.notesState). |
type.tab | Read/write, numeric |
The number of characters in a tab field in the current output window. If type.tab = 0, then the individual worksheet column widths are maintained in the output window after executing the type.wks(wksName) method. |
Method | Description |
---|---|
type.addKey(keyname) |
Add a key to the type object. |
type.beginResults([keyname]) |
Notify the Results Log of a block of results. When the Results Log receives this notification, it appends a header in the log. headers are used to separate different blocks of results. If a keyname is passed, it will appear in the result's header with an index. The index is tracked by the type object. |
type.clearResults([keyname[, firstindex[, lastindex]]]) |
Clear the Results Log. If a keyname is passed, then only the results with the keyname will be cleared. If no keyname is passed, then all results will be cleared. Examples: type.clearResults(FIT); // delete all results with FIT keyname type.clearResults(FIT3); // delete results with FIT keyname and index 3 type.clearResults(FIT,3); // same as type.clearResults(FIT3) type.clearResults(FIT,3,8); // delete results with FIT keyname and index from 3 to 8 |
type.delKey(keyname) |
Delete a key from the type object. |
type.endResults() |
Notify the Results Log that the block of results has ended. It is necessary to notify the Results Log that a block of results has ended so it can separate the logs with headers. |
type.msgBox(Msg ,Title[, Button, Icon]) |
Display a modal Windows message box. Msg displays as the message in the window. Title displays as the title. Button: 0 = OK, 1 = OK and Cancel, 2 = Yes and No, 3 = Yes, No, and Cancel. Icon: 0 = None, 1 = Question, 2 = Information, 3 = Stop, and 4 = Exclamation. Returns the value of the button clicked on: 0 = Cancel, 1 = OK, 2 = Yes, and 3 = No. |
type.outputLog(header) |
Appending a header to the Results Log. Values for header: |
type.redirection(on, off) |
This method allows you to turn on and off the bits for the type.redirection property. The first argument switches the bits on and the second argument switches them off. This method returns the current setting of type.redirection. |
type.remind(iniSec, iniFile) |
This method creates a private reminder message dialog. An Ini file is used to initialize the dialog. Each section in the ini file is used for a single message. Sample Ini Section [MyMessage] ;Title = My Reminder Msg = This is my message. Btns = 4 The following keys in the section are used: Origin C programmers, see PrivateReminderMessage |
type.showScript(value) |
Control the display of the Script window. value: 1 = show, 0 = hide. |
type.showStatus(value) |
Control the display of the status bar. value: 1 = show, 0 = hide. |
type.wks(wksName) |
Copy the contents of the specified worksheet to the current output window as determined by type.redirection. |
This script sets the Results Log as the current output window. It clears the Results Log and then outputs "Start My Output" followed by the data in the data1 worksheet, maintaining the column widths in the output.
old = type.redirection; type.redirection = 16; type.clearResults(); type "Start My Output"; type.repeatCol = 0; type.tab = 0; type.wks(data1); type.redirection = old;