Progress
Language Reference


MEMBER Function

Interfaces
OS
SpeedScript
All
All
Yes

Parses a reference to a member of a Progress r-code library and returns the simple member name.

SYNTAX

MEMBER ( string )  

string

A character expression (a constant, field name, variable or expression that results in a character value) whose value is the pathname of a file in an r-code library.

The MEMBER function parses a character string in the form path-name<<member-name>>, where path-name is the pathname of a library and member-name is the name of a file within the library, and returns member-name. The double angle brackets indicate that member-name is a file in a library. If the string is not in this form, the MEMBER function returns the unknown value (?).

Use the MEMBER function with the SEARCH function to determine whether a file is in a library. If a data file is in a library, you must first extract the file from the library in order to read it. (See the Progress Client Deployment Guide for more information on extracting a file from a library.) The SEARCH function returns a character string in the form path-name<<member-name>> if it finds a file in a library.

EXAMPLE

This procedure prompts for the name of a file. Using this value, the procedure searches for the file. If it does not find the file, it displays a message and ceases operation. If it does find the file, it tests to see if the file is in a library. If so, the procedure displays the filename and the name of the library. Otherwise, the procedure displays the pathname of the file returned by SEARCH.

r-memb.p
DEFINE VARIABLE what-lib AS CHARACTER.
DEFINE VARIABLE location AS CHARACTER.
DEFINE VARIABLE myfile   AS CHARACTER FORMAT "x(16)" LABEL "R-code File".

SET myfile.
location = SEARCH(myfile).

IF location = ?
THEN DO:
   MESSAGE "Can’t find" myfile.
   LEAVE.
END.

what-lib = LIBRARY(location).

IF what-lib <> ? 
THEN MESSAGE MEMBER(location) "can be found in library" what-lib.
ELSE MESSAGE myfile "is not in a library but is in" location. 

SEE ALSO

LIBRARY Function, SEARCH Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095