GetAbsolutePath()

Summary

Converts a relative pathname to an absolute pathname.

Changes

Added to Version 2019.

Syntax

GetAbsolutePath(string ref_path, string rel_path)

Argument Contents
ref_path The reference pathname used by the relative pathname
rel_path The relative pathname to be converted to an absolute pathname

Returns

The absolute pathname.

Error Codes

Error Type Meaning
Error The reference pathname does not exist

Notes

  • The relative pathname is the portion of the absolute pathname that is not included in the reference pathname.

Examples

folder = RunMacro("G30 Tutorial Folder")
absolute_path = GetAbsolutePath(folder, "customer.dbf")
ShowMessage("The absolute pathname for " + file_name + " is " + absolute_path)
result = GetAbsolutePath("C:\\projects", "inputs\\test")
// result = "C:\\projects\\inputs\\test"

See Also

Function Summary
CompactPath() Shortens a file's pathname to the listed length for purposes of display.
GetLongPathName() Returns the full, long pathname for a file
GetRelativePath() Converts an absolute pathname to a relative pathname.
GetShortPathName() Returns the short pathname for a file
IsPathAbsolute() Tests to see if the pathname is an absolute pathname
SplitPath() Splits a path and filename into its component parts