AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos XLS
  • Returning the last error that occurred on an XLS file
  • Returning the last error that occurred on an XLS file
xlsMsgError (Example)
Returning the last error that occurred on an XLS file
WINDEVCódigo de Usuario (UMC)
The following code returns an error message if xlsOpen and xlsData threw an error.
// Declare the variables
ResData is string
XLSFileID is int
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS")
IF XLSFileID <> -1 THEN
// Retrieve the content of a cell
ResData = xlsData(XLSFileID, 3, 4)
IF ResData = "" THEN
IF xlsMsgError(XLSFileID) = "" THEN
// The cell is empty
Info("The cell is empty")
ELSE
// Display an error message if the retrieval was not performed
Error(xlsMsgError(XLSFileID))
// Identical to: Error(ErrorInfo(errMessage))
END
ELSE
// Display the content of the cell
Info("The content of the cell is: " + ResData)
END
ELSE
// Display an error message if the opening was not performed
Error(xlsMsgError(XLSFileID))
// Identical to: Error(ErrorInfo(errMessage))
END
Returning the last error that occurred on an XLS file
The following code returns an error message if xlsOpen and xlsData threw an error.
// Declare the variables
ResData is string
XLSFileID is int
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS")
IF XLSFileID <> -1 THEN
// Retrieve the content of a cell
ResData = xlsData(XLSFileID, 3, 4)
IF ResData = "" THEN
IF xlsMsgError(XLSFileID) = "" THEN
// The cell is empty
Info("The cell is empty")
ELSE
// Display an error message if the retrieval was not performed
Error(xlsMsgError(XLSFileID))
// Identical to: Error(ErrorInfo(errMessage))
END
ELSE
// Display the content of the cell
Info("The content of the cell is: " + ResData)
END
ELSE
// Display an error message if the opening was not performed
Error(xlsMsgError(XLSFileID))
// Identical to: Error(ErrorInfo(errMessage))
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local