PreviousNextIndex

SEARCH function

Searches the directories and libraries defined in the PROPATH environment variable for a file. The SEARCH function returns the full pathname of the file unless it is found in your current working directory. If SEARCH does not find the file, it returns the Unknown value (?).

Syntax

SEARCH ( opsys-file ) 

opsys-file
Example

In this procedure, the SEARCH function returns the fully qualified pathname of the filename entered if it is not in the current working directory. If SEARCH cannot find the file, it returns the Unknown value (?). The procedure displays the fully qualified pathname or a message indicating that the file could not be found.

r-search.p
DEFINE VARIABLE fullname AS CHARACTER NO-UNDO FORMAT "x(55)". 
DEFINE VARIABLE filename AS CHARACTER NO-UNDO FORMAT "x(20)". 
REPEAT: 
  UPDATE filename HELP "Try entering ’help.r’ or ’dict.r’" 
    WITH FRAME a SIDE-LABELS CENTERED. 
    fullname = SEARCH(filename). 
    IF fullname = ? THEN 
      DISPLAY "UNABLE TO FIND FILE " filename 
        WITH FRAME b ROW 6 CENTERED NO-LABELS. 
    ELSE 
      DISPLAY "Fully Qualified Path Name Of:" filename SKIP(2)  
        "is:" fullname WITH FRAME c ROW 6 NO-LABELS CENTERED. 
END. 

Notes

OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex