Prototype
subroutine EcsGetLastNonBlankLineNumber(integer:StartLine, integer:LineNumber)
Description
Line-oriented. Copies the number of the last non-blank line at or above a specified starting line into an integer variable.
Parameters
StartLine |
Input |
An integer denoting the line on the screen where to start checking for a blank line. The number must be greater than zero and less than or equal to the number of lines on the screen. |
LineNumber |
Output |
A reference to an integer that will receive the number of the line that is non-blank at or above the specified line. |
Return Value
ECS_E_NOTINIT |
Not initialized - command was ignored |
ECS_E_NOTCONN |
Not connected to an active session |
ECS_E_LINENUM |
Invalid line number |
ECS_E_ERRORFREE |
No errors were generated |
Example
###****************************************
### Action to find the last non-blank line
###****************************************
action GetLastNonBlank is
copy text of StartLine_SB to SessionRows_IV
call EcsGetLastNonBlankLineNumber ( SessionRows_IV, Indicator_IV )
copy errorlevel to ErrorLevel_IV
copy "EcsGetLastNonBlankLineNumber" to Call_SV
if ( ErrorLevel_IV = ECS_E_ERRORFREE )
then
copy "Last non-blank line is " Indicator_IV to Message_SV
action DisplayMessage
else
action DisplayError
end if
make GetLastNonBlank_DB invisible
make GetLastNonBlank_DB temporary