DisplayPath( ) Function

Truncates long path expressions to a specified length for display.

DisplayPath(cFilename, nMaxLength)

Returns

Character data type. DisplayPath( ) returns a string and displays the path in title (proper) case.

Parameters

  • cFileName
    Specifies the name of the file at the end of the target path. If you specify no path, Visual FoxPro uses the value of CURDIR( ).

    Note   This function does not check the validity of cFileName and will report the truncated path expression even if no such file exists.

  • nMaxLength
    Specifies the maximum length of the truncated result. nMaxLength must be greater than or equal to 10.

Remarks

DisplayPath( ) returns a string suitable only for display purposes, so you cannot use the result to reference a file. The length of the resulting string is equal to or less than nMaxLength. However, the result does not break directory names. If inclusion of a directory name would exceed nMaxLength, the result is an ellipsis (...). If the filename exceeds nMaxLength, the result is the filename plus extension.

See Also

JUSTPATH( ) Function | ADIR( ) Function