CGridView:GetType


The GetType method sets the data type of a grid cell. A cell value can always be retrieved as a string, but there may be occasions when the data need to be interpreted as other types of information.

Syntax

CGridView:SetVal( nCol, nRow, data_type )

bullet.gif    Where nCol, and nRow are the coordinates of the cell to set.

bullet.gif    Where cell_type is the type of information to specify for the specified cell.

Remarks

The data_type number specifies the interpretation of the cell values, as defined in the table below.

 

Data Type

Value Type

1

String

2

Number

3

Boolean true or false

4

Time, as a string

5

Currency, as a string

10

Special time (hh:mm:ss.sss)

11

Special date (yyyy/mm/dd)

12

Special degrees (dd:mm:ss.sss or +dd°mm'ss.sss")

other (1)

String

Example

The following script sets the cell contents of (column 5, row 10) to "My value":

G = attach_gridview()

-- attach a grid on the Mira desktop

type = G:GetType(5,10)

-- return the type of cell (5,10)

if type == 1 then

-- if this is a string value...

  Printf("value = %s\n", value)

-- print a string

elseif type == 2 then

-- else if this is a numeric value...

  Printf("value = %d\n", value)

-- print a number

end

 

Related Topics

CGridView class, SetType, GetVal


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.