BBjProgramInfo::getListingForLine

Description

In BBj 22.11 and higher, this method returns the listing for a specified user-defined or physical line of a program referenced by a BBjProgramInfo object.

Syntax

Return Value Method
string

getListingForLine(int line)

Parameters

Variable Description
line

The line number to be retrieved from the BBjProgramInfo object.

If this program has user-defined line numbers (see BBjProgramInfo::hasLineNumbers), the line number must be a user-defined line number that exists in the program.

If the program does not have user-defined line numbers, this method is identical to BBjProgramInfo::getListingForPhysicalLine.

Return Value

Returns the program listing for a given user-defined or physical line of a BBjProgramInfo object.

Remarks

If the underlying program is protected, this method throws an !ERROR=62 (Protected Program). If the specified user-defined or physical line does not exist in the program, this method throws an !ERROR=21 (No Such Line Number).

Example

rem ' BBjProgramInfo::getListingForLine Example

rem 'Get a specific  line of a BBjProgramInfo object.

Hello!=BBjAPI().getProgramInfo("Hello.bbj")
print Hello!.getListingForLine(10)

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.