Spread 8.0 Documentation
SSGetValue, SSSetValue, SSSetValueRange Functions
Support Options
DLL Reference > DLL Functions > SSGetValue, SSSetValue, SSSetValueRange Functions

Glossary Item Box

SSGetValue, SSSetValue, SSSetValueRange Functions


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Set or return unformatted data in a cell or set data for a block of cells.

Syntax

C

int SSGetValue(HWND hWnd, SS_COORD Col, SS_COORD Row, LPTSTR lpBuffer);

BOOL SSSetValue(HWND hWnd, SS_COORD Col, SS_COORD Row, LPCTSTR lpData);

BOOL SSSetValueRange(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPCTSTR lpData);

C++

int TSpread::GetValue(SS_COORD Col, SS_COORD Row, LPTSTR lpBuffer);

BOOL TSpread::SetValue(SS_COORD Col, SS_COORD Row, LPCTSTR lpData);

BOOL TSpread::SetValueRange(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, LPCTSTR lpData);

Parameters

The SSGetValue function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number
Row Row number
lpBuffer Pointer to string in which to place value

The SSSetValue and SSSetValueRange functions have the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of cell or column number of upper-left cell of the block if specifying a block for the SSSetValueRange function
Row Row number of cell or row number of upper-left cell of the block if specifying a block for the SSSetValueRange function
Col2 Column number of lower-right cell of the block if specifying a block for the SSSetValueRange function
Row2 Row number of lower-right cell of the block if specifying a block for the SSSetValueRange function
lpData String containing data to be set

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function. To determine the settings you want for the Col, Row, Col2, and Row2 parameters, see Using Column and Row Properties.

Remarks

Use the SSSetValueRange function to set the value for a block of cells.

When adding data using the SSSetValue and SSSetValueRange functions, remove all formatting characters in the data. The following table explains the data format to use when setting data and the format returned when returning data. Values in quotation marks (" ") are string values.

Cell Type Sample Data Set or Return Data
Button True (Two-state) "1"
False (Two-state) "0"
Not set (Two-state; looks False) "0"
Check Box True "1"
False "0"
Grayed "2"
Not set; looks False "0"
Combo Box Index number of selected item
Currency "$10,000.00" "10000.00"
Date "10/29/2001" "10292001"
When setting, provide date value as "MMDDYYYY".
Edit Text string
If the SSSetTypeEdit function's Style parameter is set to ES_MULTILINE, a linefeed character ('\n' in C++) can be used to force a line break when setting text.
Number "10,000.00" "10000" or "1E4"
Owner-Drawn not applicable
Percent "15%" "0.15"
PIC "22-45-76" "224576"
Picture not applicable
Scientific "2.22E+05" "222222"
Static Text Text string
If the SSSetTypeStaticText function's TextStyle parameter is set to SS_TEXT_WORDWRAP, a linefeed character ('\n' in C++) can be used to force a line break when setting text.
Time "11:25:03 pm" "232503"
When setting, provide time value as "HHMMSS" using 24-hour format.

Note: Using the SSGetValue, SSSetValue, or SSSetValueRange function for edit, owner-drawn, or static text cell types is equivalent to using the SSGetData, SSSetData, or SSSetDataRange function.

If you set the Col or Row parameter to SS_ALLCOLS or SS_ALLROWS or you call the SSSetValueRange function to set data for multiple cells, the same data is placed in each cell. If you set the Col or Row parameter to SS_ALLCOLS or SS_ALLROWS to return data from multiple cells, unless the cells were set with the Col or Row parameter set to SS_ALLCOLS or SS_ALLROWS, the function does not return a value.

Note: The SSGetValue function does not return the text in a column or row header cell unless the cell contains custom text. The function does not return the auto text in the header cells.

Refer to Formatted and Unformatted Data for more information about formatted versus unformatted data.

Return Value

SSGetValue: Length of value if successful; zero otherwise.
SSSetValue: Nonzero if successful.
SSSetValueRange: TRUE if the function completes successfully; FALSE otherwise.

See Also

Adding Data
Returning Data
Creating and Customizing a Static Text Cell

SSClipValueIn, SSClipValueOut, SSGetData, SSGetFloat, SSGetInteger, SSGetValueLen, SSSetFloat, SSSetFloatRange, SSSetInteger, SSSetIntegerRange, SSSetData, SSSetDataRange functions

ActiveX Correspondence

Value property

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.