APGen Documentation Previous Topic: Util Object Next Topic: Util.BuildRelativePath() Parent Topic: Util Object    Util Object
Util.ConcatPath()
See Also:

The Util.ConcatPath() method combines an absolute path with a (relative?) path.

Syntax

VBScript:

strPath = Util.ConcatPath( strAbsolutePath, strRelativePath [, bIsDir] )

JScript:

strPath = Util.ConcatPath( strAbsolutePath, strRelativePath [, bIsDir] );

Object

Util The Util object.

Parameters

strAbsolutePath An absolute path.
strRelativePath A relative or absolute path.
bIsDir Optional.  Specify True if strAbsolutePath is known to be a directory.  The default value is False.
True: strAbsolutePath is a directory.

False: strAbsolutePath is a directory only if it ends with a slash.  Otherwise it is a file.

Return Value

strPath The path created by starting at  strAbsolutePath and following  strRelativePath.  If strRelativePath is an absolute path, then it is returned.

Notes

All APGen object properties return directory strings that end with a '/' or '\' character.  For example, the return values from Script.Dir and Output.Dir will always end with a slash, but the return values from Script.Path and Output.Path will never end with a slash.  Thus when using APGen object properties in Util.ConcatPath(), the value of the bIsDir parameter does not affect the outcome. 

Paths are considered absolute or relative, and are combined, according to standard path definitions.  Following are examples of permissible path values:

file.ext Relative path
.\file.ext Relative path
dir\file.ext Relative path
..\dir\file.ext Relative path
\dir1\dir2\file.ext Relative path
c:\dir\file.ext Absolute path
//computer/share/dir/file.ext Absolute path

Example

This code snippet uses Util.ConcatPath() to compute the absolute path of a directory that is at a known relative path to the APG script.

Dim sImgDir
sImgDir = Util.ConcatPath(Script.Dir, "..\..\img\")

Applies To

Util Object