PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Available masks
  • Defining a mask on a column
  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
SpreadsheetTypeAndMaskSelection (Function)
In French: TableurTypeEtMasqueSélection
Returns or modifies the type and the mask of the cells selected in a Spreadsheet control found in a window.
Note: This function can be used for example to create a formatting bar for a Spreadsheet control.
Example
// CLICK on [NUMBER] - Change of mask
SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet, typInputNum, "999 999 999,99")

// CLIC on [Long DATE].
// Change of mask: for example 19 -> "Sunday 19 January 1900"
SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet, typInputDate, "DDD D MMMM YYYY")
// Returns the selection mask
sRes is string
nType is int
sMask is string
sRes = SpreadsheetTypeAndMaskSelection(PSHEET_Spreadsheet)
nType = Val(ExtractString(sRes, 1, TAB))
sMask = Val(ExtractString(sRes, 2, TAB))
Syntax

Finding out the type and mask of selected cells Hide the details

<Result> = SpreadsheetTypeAndMaskSelection(<Spreadsheet Control>)
<Result>: Character string
Mask of selected cells. This mask has the following format:
<Type> + TAB + <Mask>
where:
  • <Type> corresponds to one of the following constants:
    typInputDateDate type
    typInputDurationDuration type
    typInputTimeTime type
    typInputCurrencyCurrency type
    typInputNumNumeric type (integer, real, ...)
    typInputTextText type
  • <Mask> corresponds to the mask used.
<Spreadsheet Control>: Control name
Name of Spreadsheet control to use.

Modifying the type and mask of selected cells Hide the details

SpreadsheetTypeAndMaskSelection(<Spreadsheet Control> , <Type> , <Mask>)
<Spreadsheet Control>: Control name
Name of Spreadsheet control to use.
<Type>: Integer constant
New type for the selected cell:
typInputDateDate type
typInputDurationDuration type
typInputTimeTime type
typInputCurrencyCurrency type
typInputNumNumeric type (integer, real, ...)
typInputTextText type
<Mask>: Character string (with quotes)
New mask to use (the mask depends on the selected type).
Remarks

Available masks

The available masks depend on the type of mask. All the masks that can be used with ..InputMask are available. See the help about ..InputMask for more details.
Some examples:
  • on a date: you have the ability to use the "DD/MM/YYYY" mask.
  • on a numeric: you have the ability to use the "999 999" mask.
Notes:
  • (typInputText, "") means "no mask".
  • The mask defined by SpreadsheetTypeAndMaskSelection can be modified by ..InputMask.
    Caution: only the mask can be modified, the type of cell is not modified.

Defining a mask on a column

To define a mask on a column, all you have to do is select the column and apply the requested mask. Example:
SpreadsheetSelectPlus(PSHEET_NoName1, "A")
SpreadsheetTypeAndMaskSelection(PSHEET_NoName1, typInputDate, "DD-MM-YY")

Various

  • The modification operation is added into the list of operations to cancel: the user can cancel this operation via the popup menu or by pressing [CTRL] + Z.
  • This function can only be used on a Spreadsheet control found in a window.
Related Examples:
The Spreadsheet control Unit examples (WINDEV): The Spreadsheet control
[ + ] Using the Spreadsheet control.
This example explains how to:
- load an xlsx file in a spreadsheet control,
- save the spreadsheet in a file,
- fill the control with data coming from the database,
- insert rows, columns,
- access the cells and handle them (modify their value, their style, ...),
- enter formulas,
- ...
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment