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

    • Programming API Codes

      This document is provided for Elliott software developers. If you are not an Elliott software developer, this document is not meaningful for you. AP: Get SMA Values This API returns various values from the Shared Memory Area. For example: Move ‘AP’ ...
    • 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 ...
    • ID API

      Release Date: 3/19/2019 The ID API will return the current Help ID (the current major Application program running in Elliott): MOVE "ID" TO SCREEN-PARAMETERS. PERFORM SCREEN-ROUTINE. MOVE SCREEN-ALPHA-FIELD TO MY-LOCAL-HELP-ID. In certain situations, ...
    • 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 ...
    • 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 ...