Home | Sign in | English  Help WLanguage WLanguage functions Standard functions Numeric values management functions Matrix functions MatReadLine Presentation Example Matrix existence Size of Extracting an element value from Managing errors Related examples See also  MatAdd MatCopy MatCreate MatDelete MatDeterminant MatError MatExist MatFill MatFloatAdd MatFloatMultiply MatInvert MatMultiply MatNbColumn MatNbLine MatRead MatReadColumn MatReadLine MatStack MatTranspose MatWrite Matrix management functions The matrices
• Matrix existence
• Size of
• Extracting an element value from
• Managing errors
WINDEV      WEBDEV    WINDEV Mobile       Others In french: MatLitLigne
Reads the value of all elements found in a matrix row. Versions 25 and later This function is now available in browser code. New in version 25 This function is now available in browser code. This function is now available in browser code.
// Read the elements found in row 5
Syntax
<Result> = MatReadLine(<Matrix> , <Row to read> [, <Total element size> [, <Number of decimals> [, <Element format>]]])
<Result>: Character string
Value of all the elements found in the specified row, in the following format:
<Value of element 1> + TAB + <Value of element 2> + TAB + ...
+ TAB + <Value of element N>
<Matrix>: Character string
Name of the matrix to be read, defined with MatCreate.
Number of the row to read.
<Total element size>: Optional integer
Total size of an element to handle. This size includes the sign, the thousand separator, the decimal point, the exponent, the integer parts and the decimal parts of the element value.
• If the element has more than <Total element size> digits, <Total element size> is increased.
• If the element has less than <Total element size> digits, <Result> is filled with spaces.
• If <Total element size> is not specified, the value of the element read will have the size of its significant part.
• <Total element size> must not exceed 100.
• If <Total element size> is set to 0, the value of the element will have the size of its significant part.
<Number of decimals>: Optional integer
Number of decimals to read. This parameter always starts with a dot ("."). The last decimal will be rounded. This parameter only affects the float notations ("f") and the exponential notations ("e" and "E"). <Total element size> is ignored if <Number of decimals> is greater than <Total element size>.
 "d" type (integer) "e" or "E" type (exponential notation) and "f" type (float notation) .0 - 0 .N - N (if N is greater than the number of decimals, the decimal part will be filled with zeros) (not specified) - 6
<Element format>: Optional character
Format for representing an element:
• d: the value of the element is expressed as a signed integer. The digits found after the decimal point are truncated and <Number of decimals> is ignored.
• e or E: exponential notation with 1 digit before the decimal point, <Number of decimals> digits after the decimal point and at least 2 digits for the exponent.
Remarks

Matrix existence

The matrix existence is not checked. To check the matrix existence, use MatExist.

Size of <Result>

Caution: The size of the character string returned in <Result> cannot exceed 260 characters. If the matrix row contains more characters, the string returned in <Result> will contain the first 260 characters only.

Extracting an element value from <Result>

To extract one or more element values from <Result>, use ExtractString.

Managing errors

Caution: MatReadLine returns no error code. To find out whether errors have been generated when reading the row elements, use MatError. To get the details of the error, use ErrorInfo with the errMessage constant.
Related Examples: Unit examples (WINDEV): The Matrix functions [ + ] Using matrices with the WLanguage functions.This example, powered by WINDEV, is used to perform calculations on matrices: addition, multiplication, transposition, inversion... Unit examples (WINDEV Mobile): The Matrix functions [ + ] Using matrices with the WLanguage functions: addition, multiplication, transposition, inversion...
Business / UI classification: Neutral code
Component: wd270mat.dll
Minimum version required
• Version 9