LF API

LF API

Release Date: 9/7/2021

Versions: 8.0 and higher

This API takes a filespec, like C:\WINDOWS\*.*, and returns the next file in the specified directory for each successive call. 

Screen Parameters

Comment

LF,nn

Input:

SCREEN-LITERAL contains the filespec, with wildcards, that will be used for returning matching files.

Output:

SCREEN-ALPHA-FIELD:

contains .the next matching file in the directory, without the directory name.  If there is no more matching file, SCREEN-ALPHA-FIELD will return SPACES.

SCREEN-NUMERIC-FIELD:

contains the size, in bytes, of the returned file.

 

Whenever SCREEN-LITERAL changes, the search will begin again at the beginning of the directory.

 

Nn=99 means terminate the search; even if the next call has the same value in SCREEN-LITERAL as the previous call, the file returned after the nn=99 call will be the first matching file in the directory.

 Example:

      *> Make sure any prior LF sequence is terminated...
        MOVE "LF,99" TO SCREEN-PARAMETERS
        PERFORM SCREEN-ROUTINE
 
      *> Get the first matching file...
        MOVE "LF" TO SCREEN-ROUTINE
        MOVE "C:\WINDOWS\*.*" TO SCREEN-LITERAL
        PERFORM SCREEN-ROUTINE

      *> Process each file until there are no more...
        PERFORM UNTIL SCREEN-ALPHA-FIELD = SPACES
            PERFORM PROCESS-ONE-FILE
            PERFORM SCREEN-ROUTINE
        END-PERFORM

Note: The program called by this API is used both on the application side and on the system side.  Application-side LF processing loops are protected from system-side LF-like processing loops -- i.e., the application-side LF loop will not be interrupted by any system-side LF-like processing.  However, multiple application-side LF loops will interfere with each other.  Therefore, while your code is in an LF processing loop, make sure there is no downstream application code that uses the LF API.

JEG



    • Related Articles

    • EM API - Create and Send an Email

      Release Date: 12/23/20 Version: 7.0 and Higher This is a set of API calls introduced after Elliott 6.X.060. Use them collectively. They will send out emails through the SMTP or MAPI interface. Developers who use these API calls do not need to know ...
    • 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 ...
    • 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 ...
    • GK API

      Release Date: 07/08/2021 Revised Date: 05/05/2022 This API allows the programmer to determine whether or not certain keystrokes have been pressed. Screen-Parameters: GK,nn nn provides different functionality as follows: GK Wait for the next keystroke ...
    • 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 ...