3.7.5.4 Create

LabTalk Object Type:

Utility

The create object is used to create a custom minimized worksheet.

Please see the newbook X-Function.

Properties:

Property Access Description
create.datan$ Read only
string

Returns the nth created dataset created with the create.wks() method.

create.enumerate Read/write
numeric

Enumerate worksheet columns: 1 = enable. When using create.wks(), if the columns passed already exist in the worksheet, then add new enumerated columns based on the column names.
0 = disable. If the columns already exist, overwrite them.

create.enumWks Read/write
numeric

Enumerate worksheet. 1 = enable. When using create.wks(), if the worksheet set by create.wksname$ already exists, create a new enumerated one.
0 = disable. If the worksheet exists, use that worksheet. Otherwise create it.

create.npts Read/write
numeric

Total number of rows in the worksheet. Default is 60. The minimum is 25.

create.numTypes Read/write
numeric

If specified, it determines the total number of column types. If this is not specified, then the total number of column types is equal to the nth value in create.type. The default is 0 and is user-assigned only (it is never set internally).

create.readOnly Read/write
numeric

Set the worksheet as read only. 1 = enable. 0 = disable.

create.template Read/write
numeric

Name of the worksheet template to use to create the worksheet. Most Origin scripts use CREATE.OTW. Example: create.template$ = "Create"; will use CREATE.OTW to create the worksheet.

create.typen Read/write
numeric

n can be 1 to 20. This specifies the column type for the columns created by create.wks(). If more columns are being created than the number of types, then the "pattern" is repeated unless typeN is specified. Example: Type1 = 4; Type2 = 1: this will make the columns X and Y repeatedly (unless TypeN is specified) until the total number of columns (specified in wks() method) are created.

create.typeN Read/write
numeric

This value is used if the number of columns being created is greater than the total number of types specified. If typeN = 0, then the rest of columns will get the same type as the first set of columns. Default is 0. Example: create.type1 = 4; create.type2 = 1; create.typeN = 6; When create.wks() is executed, it will create one X column, one Y column, and the rest of the columns created will be Z columns.

create.wksLabel$ Read/write
string

Set the label for the worksheet created with the create.wks() method.

create.wksName$ Read/write
string

String property to specify the name of the worksheet. After create.wks() is executed, it holds the name of the last worksheet created.

Methods:

Method Description
create.delete(colName)

Deletes the column and the associated datasets. If a Y column is specified, the associated X, Err, and Label columns will also be deleted. If an X column is specified, the dependant Y columns will be deleted. The worksheet this operates on is specified in create.wksName$.

create.reset()

Currently not implemented.

create.wks(colName)

Create a minimized worksheet with the name set to the string stored in create.wksName$. If colname equals an existing dataset, concatenate and truncate (if necessary) the name by removing the "_".

Examples:

The following script creates a hidden worksheet named Test1 with an X and Y column.

 
create.wksName$ = "Test";
create.enumwks = 1;
//If worksheet exists, truncate and enumerate name of 
//next wks
create.wkslabel$ = "This is a test worksheet";
create.template$ = "CREATE";
//Use the CREATE.OTW
create.npts = 30;
//Set the number of rows
create.enumerate = 1;
//If columns passed already exists, 
//truncate and enumerate newly created columns
create.numtypes = 2;
//Only two types of columns will be used
create.type1 = 4;
//Only explicitly specify 1st type as X
create.type2 = 1;
//Set TypeN = Y column type
create.wks(A B);
//Create wks named Test with X column=A and Y column=B
%A = create.data1$;
//Set %A to first created dataset
%B = create.data2$;
// Set %B to second created dataset
%K = create.wksname$;
//Set %K to name of last worksheet created