AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de valores numéricos / Funciones de matrices
  • Adding a value to all the matrix elements
MatFloatAdd (Example)
Adding a value to all the matrix elements
The following code is used to add the value 5 to all the matrix elements. The name of the matrix is entered by the user in an edit control (EDT_MatrixName).
We assume that the matrix is already created. The existence of the matrix is checked by MatExist.
// --Click code on BTN_AddValue
// Declare the variables
ResAddReal is boolean
// Checks whether the matrix exists
IF MatExist(EDT_MatrixName) = True THEN
// Adds the value 5 to all matrix elements
MatFloatAdd(EDT_MatrixName, 5)
// Error?
IF MatError(EDT_MatrixName) = 0 THEN
Info("The addition was performed")
ELSE
// Display the error message
Error(ErrorInfo(errMessage))
END
ELSE
Info("The matrix does not exist")
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