The following cod is used to write into a matrix. The value 7 is assigned to the element (row 2, column 3). The existence of the matrix is checked by MatExist. The matrix is created by MatCreate. The name of the matrix is entered by the user in an edit control (EDT_MatrixName).
// Declare the variables ResExist is boolean ResOverwrite is boolean ResCreate is boolean ResWrite is boolean // Checks whether the matrix exists ResExist = MatExist(EDT_MatrixName) // The matrix exists IF ResExist = True THEN // Overwrite the matrix? ResOverwrite = YesNo("This matrix already exists. Do you want to overwrite it?") END // The matrix does not exist or the matrix must be overwritten IF ResExist = False OR ResOverwrite = True THEN // Create the matrix ResCreate = MatCreate(EDT_MatrixName) END // Error? IF ResCreate = False THEN Error(ErrorInfo(errMessage)) ELSE // Write into the matrix // Reminder: The value 7 is assigned to the element (row 2, column 3) ResWrite = MatWrite(EDT_MatrixName, 7, 2, 3) IF ResWrite = True THEN Info("The write operation was performed") ELSE // Display the error message Error(ErrorInfo(errMessage)) END END
This page is also available for…
|
|
|
|