PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Type of data entered in a column: taking the empty columns into account
  • Managing errors
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
Returns the type of data entered in a column of an XLS file. The result depends on the opening mode of XLS file:
  • In multi-sheet mode, the column used is found on the worksheet selected by xlsCurrentWorksheet.
  • In compatible mode, the column used is always found on the first worksheet of the workbook.
Note: The type of data entered in a column of an XLS file is returned if:
  • The XLS file exists.
  • The XLS file is opened.
Versions 16 and later
WINDEVLinux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
New in version 16
WINDEVLinux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
// Type of data entered
ResColumnTitle = xlsColumnType(XLSFileID, 4)
SWITCH ResColumnTitle
CASE xlsTypeString: Info("String data")
CASE xlsTypeDate: Info("Date data")
CASE xlsTypeDouble: Info("Numeric data")
CASE xlsTypeTime: Info("Time data")
CASE xlsTypeDateTime: Info("DateTime data")
CASE xlsTypeDuration: Info("Duration data")
CASE xlsTypeCurrency: Info("Currency data")
END
...
END
Syntax

Syntax that is using the xlsDocument type Hide the details

<Result> = xlsColumnType(<XLS document> , <Column number> [, <Empty columns>])
<Result>: Integer constant
Type of data entered in the specified column:
xlsTypeString"Character string" column or column containing different types of data
xlsTypeDate"Date" column
xlsTypeDateTime"DateTime" column
xlsTypeDouble"Numeric" column
xlsTypeDuration"Duration" column
xlsTypeTime"Time" column
xlsTypeCurrency"Currency" column
xlsTypeEmptyColumn entirely empty if <Empty columns> = False
xlsTypeErrorIf an error occurs. For more details on the error, use xlsMsgError or ErrorInfo with the constant errMessage.
<XLS document>: xlsDocument variable
Name of xlsDocument variable corresponding to the XLS file to use.
<Column number>: Integer
Number of the column to read.
<Empty columns>: Optional boolean
Mode for taking the empty columns into account:
True
(by default)
The columns that are entirely empty are ignored
FalseThe columns that are entirely empty are taken into account

Syntax kept for backward compatibility with version 12 Hide the details

<Result> = xlsColumnType(<Identifier of XLS file> , <Column number> [, <Empty columns>])
<Result>: Integer constant
Type of data entered in the specified column:
xlsTypeString"Character string" column or column containing different types of data
xlsTypeDate"Date" column
xlsTypeDateTime"DateTime" column
xlsTypeDouble"Numeric" column
xlsTypeDuration"Duration" column
xlsTypeTime"Time" column
xlsTypeCurrency"Currency" column
xlsTypeEmptyColumn entirely empty if <Empty columns> = False
xlsTypeErrorIf an error occurs. For more details on the error, use xlsMsgError or ErrorInfo with the constant errMessage.
<Identifier of XLS file>: Integer
Identifier of XLS file to handle, returned by xlsOpen.
<Column number>: Integer
Number of the column to read.
<Empty columns>: Optional boolean
Mode for taking the empty columns into account:
True
(by default)
The columns that are entirely empty are ignored
FalseThe columns that are entirely empty are taken into account
Remarks

Type of data entered in a column: taking the empty columns into account

The empty columns can be taken into account or not. For example:
xlsColumnType(XLSFileID, 2, True) // Returns xlsTypeString
xlsColumnType(XLSFileID, 2, False) // Returns xlsTypeEmpty

Managing errors

xlsColumnType generates an error in the following cases:
  • The specified column does not exist (negative column for example).
  • The specified XLS file is not opened.
Component : wd240xls.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment