The GetLine method retrieves the text string contained in the specified line.


The arguments are:


The one-based line number to be retrieved.


The maximum number of characters to be retrieved. Object Rexx allocates the appropriate amount of memory to store the text string. If the line consists of more characters than fit in the memory, the text string is truncated. If you omit this argument, the maximum number of characters retrieved is 255.

Return value:

A text string or an empty string.


The following example stores all lines contained in edit control EDITOR in a stem. If a line consists of more than 1024 characters, it is truncated.

edit = MyDialog~GetEditControl("EDITOR")
if edit == .Nil then return
do i = 1 to edit~Lines
   lines.i = edit~GetLine(i, 1024)

Note: The carriage return and line-feed characters are not included in the returned text string. To get the contents of a single line edit control, use the GetText) method, or use edit~GetLine if there is no need to worry about truncation, or use edit~GetLine(1, [maxLength]) if the length of the text is greater than 255.