Returns information about the currently accessed application directories.



Return Value

Character string.


$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.


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."
  output "read."
 output "Directory Dir1 is NOT accessed."

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


Related Topics