$dirpath

Returns information about the currently accessed application directories.

Syntax

$dirpath()

Return Value

Character string.

Comments

$dirpath returns a character string consisting of the names of all currently accessed application directories and their access types (U for update, R for read). Information about each directory is enclosed in semicolons (;). The directory name appears first, followed by the access type in parentheses.

Directories appear in the order that they were accessed; that is, the most recently accessed directories appear first.

Example

access dir1
access dir2 update
output $dirpath()

Prints the string; dir2(U);dir1(R);ZIM(U);_$ZimServices(R);_$session$_(U);

let vDirPath = $dirpath()
let vPos = $position($toalpha(vDirPath, -1), ";Dir1(")
if vPos > 0
 output "Directory Dir1 is accessed ";
 if $substring(vDirPath,vPos+6,1)="U"
  output "update."
 else
  output "read."
 endif
else
 output "Directory Dir1 is NOT accessed."
endif

Uses $position to test if a particular directory is accessed.

 

Related Topics