LN API

LN API

Release Date: 5/17/17

LN: Length of String
The LN API allows the developer to pass a string with a maximum length of 4000 bytes. The system will determine the position of the last non-space character in the string and pass the position back through SCREEN-NUMERIC-FIELD.
Using this API call is faster than using a traditional loop that reads from the end of a string.

Screen-Parameters:
LN

Passing Variables:
Screen-Menu - Move the string to be evaluated to Screen-Menu before performing Screen-Routine.
Screen-Numeric-Field - Maximum length of the string being passed. If Screen-Numeric-Field is zero, the maximum length of 4000 is used when determining the length.

Return Values:
Screen-Numeric-Field - The length of the field will be returned in Screen-Numeric-Field.

Example:

In this example, a string with a maximum of 2048 characters will be examined.

MOVE PARSE-RECORD TO SCREEN-MENU.
MOVE 2048 TO SCREEN-NUMERIC-FIELD.
MOVE "LN" TO SCREEN-PARAMETERS.
PERFORM SCREEN-ROUTINE.
MOVE SCREEN-NUMERIC-FIELD TO LAST-POS.

Programs Modified: SCREEN.WS, SCREEN.PL, BIDSCRN.PL, CALLSCN.CBL, NWSMSCRN.CBL
CLS


    • Related Articles

    • CV API

      Release Date: 10/31/2019 This API allows the programmer to determine whether or not thie current company's .DAT files have been converted to .BTR files. Screen-Parameters: CV Check the converted status for the current company. CV,nn Check the ...
    • AP API

      AP API This API returns various values from the Shared Memory Area. For example: MOVE "AP" TO SCREEN-PARAMETERS MOVE "EDITOR" TO SCREEN-LITERAL PERFORM SCREEN-ROUTINE This returns the user’s preferred Editor in SCREEN-ALPHA-FIELD. The following ...
    • DD API Changes (V9.0)

      DD: Drill Down The Drill Down API allows the developer to drill down to another Elliott application. The information provided in SCREEN-PARAMETERS will give the system the correct information to determine if the user has rights to the application ...
    • Avalara Source Code Integration - AV API Call

      Release Date: 11/16/21 Revised: 05/23/22 Version: 8.6 and Above This article is intended for Elliott Business Software developers. This API call will allow the programmer to pass a value to indicate which Avalara function is to be performed. The ...
    • DM API Changes - Use DM,99 to Display Long Messages

      Release Date: 02/05/2024 Version: 8.2 & Up The DM API call is limited to display a message up to 80 digits. For example, you can use the following message to display a message up to 80 digits: MOVE SHORT-MESSAGE TO SCREEN-LITERAL MOVE "DM" TO ...