Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== MatWrite statement ====== ==== Description ==== Writes the values of a matrix into a record. ==== Syntax ==== **MatWrite** //matrix// On [//filevar// Cursor //cursorvar//], //key// Then Else //statements// ==== Parameters ==== The MatWrite statement has the following parameters. ^Parameter^Description^ |//matrix//|The matrix must have been previously named and dimensioned by a Dimension statement.\\ \\ All the elements of the selected matrix are written as a single row in the designated table and in an ordered manner: the data of the first element in the matrix is assigned to the first column, the data of the second element is assigned to the second column, and so on.| |//cursorvar//|Contains a cursor variable. Cursor variables are initialized with a Select...By statement and must be preceded with the key word Cursor.\\ \\ If the file being accessed has had control features added, cursor access will automatically use domain validation and conversion during a MatWrite.| |//filevar//|Must refer to a file variable name that has been previously named in an Open statement.\\ \\ If the specified file cannot be accessed, the program aborts with a runtime error message, and the elements of the matrix are left unchanged.| |//key//|The record referenced by //key// will be written to the file identified by //table_var// or the file accessed using the cursor in //cursorvar//.| |Then|The statement(s) following Then are executed if matrix is written successfully.| |Else|The statement(s) following Else are executed if the matrix cannot be written. The Status() function indicates the severity of the error, and the system variable @FILE_ERROR contains detail about the nature of the error.\\ || ==== Example ==== <code> /* The matrix CUST is written to a file. Each array element becomes a column in the row. */ Dim CUST(30) For CTR = 1 To 30 CUST(CTR) = CTR Next CTR MatWrite CUST On cust_table, CUST_NO Else status = Set_FSError() End ** ** </code> guides/programming/programmers_reference_manual/matwrite.txt Last modified: 2024/06/19 20:20by 127.0.0.1