ALINES( ) Function
Copies each line in a character expression or memo field to a corresponding row in an array.
ALINES(ArrayName, cExpression [, nFlags] [, cParseChar [, cParseChar2 [, ...]]]) |
Parameters
- ArrayName
-
Specifies the name of the array to store the copied lines in the character expression or memo field.
Note If the array you specify does not exist, Visual FoxPro automatically creates the array. If the array exists but is not large enough to contain all the lines in the memo field, Visual FoxPro automatically increases the size of the array. If the array is larger than necessary, Visual FoxPro truncates the array.
Note When used with binary values, such as Varbinary and Blob, ALINES( ) creates an array with elements that have Varbinary type.
- cExpression
-
Specifies the character expression or memo field containing the lines to copy to the array. All character expressions are case-sensitive.
Note If cExpression is the empty string or the null value, an array with a single row is created and the row contains the empty string. You can use double-byte expressions.
- [, nFlags]
-
Note In previous versions of Visual FoxPro, nFlags was the lTrim option. The lTrim option corresponds to a value of 1 for nFlag. Previous code will run identically in Visual FoxPro 9.0.
The following table describes the values for nFlags.
Bit Value (additive) Description 0
1
(Default) Removes leading and trailing spaces from lines, or for Varbinary and Blob values, removes trailing zeroes (0) instead of spaces.
1
2
Include the last element in the array even if the element is empty.
2
4
Do not include empty elements in the array.
3
8
Specifies case-insensitive parsing.
4
16
Include the parsing characters in the array.
- [, cParseChar[, c ParseChar2[, ...]]]
-
Specifies one or more character strings that terminate the elements in cExpression. When cParseChar is specified, the line breaks when cParseChar is found, and the next line continues with the character following cParseChar.
Note The maximum number of strings permitted in cParseChar is 23.
You can use a line feed (CHR(10)) or carriage return (CHR(13)) character to denote the end of a line. You can also denote the end of the line with either combination of these two characters, for example, (CHR(10) + CHR(13) or CHR(13) + CHR(10)). The default behavior for ALINES( ) is to ignore CHR(13) and CHR(10) when you specify one or more values for cParseChar, unless you also specify the end of line characters.
Note When cParseChar is omitted for Varbinary or Blob input, ALINES( ) treats the hexadecimal value 0hA (10) as a carriage return and discontinues the line at that location. The value, 0hA, is not saved in the resulting array element and might result in an incorrect binary value. For example, given the binary value, 0hFE0AF2, ALINES( ) creates a two-element array with the values, 0hFE and 0hF2.
Return Value
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08