Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> parent() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    PARENT()

Purpose:     Retrieve the parent directory for a specified directory.

Syntax:      PARENT( [ directory ] )

Arguments:   directory   - Optional character string indicating the name
                           of the directory whose parent directory you
                           wish to find.  If not specified or an invalid
                           parameter is passed, the current directory is
                           assumed.

Returns:     A character string indicating the name of the parent
             directory (i.e.  the directory above) the specified
             directory.

Description: PARENT() is an environment/character function used to parse a
             directory name and return the name of the parent directory.

Notes:       This can be useful in directory/file management routines when
             you want to let a user navigate through the directory
             structure.  Although you can get the names of sub-directories
             with ADIR(), if you want to take them 'back up' a directory,
             you have to get the current directory name, and strip it down
             to find the parent directory part.  PARENT() makes this task
             easy.

             If the current or supplied directory is at the top level
             (i.e.  the root directory), PARENT() will return '\'.

             PARENT() will return the directory portion of a fully
             qualified filename.  (See the third example)

Example:     *-- if the current directory is \APPS\CLIPPER\TEST
             ? PARENT()                             && "\APPS\CLIPPER"

             *-- PARENT() with parameters
             ? PARENT("C:\DOS\UTILITY")             && "C:\DOS"
             ? PARENT("C:\CLIPPER\CLIPPER.EXE")     && "C:\CLIPPER"

Source:      RL_PAREN.PRG

See also:    PATHTO()

See Also: PATHTO()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson