GetDir Procedure

Retrieves a directory requested.

Syntax

[ sDir = ] GetDir ( [enDir] )

The GetDir procedure syntax has the following parts:

 

Name

Type

Description

sDir

String

The directory

enDir

Val enumAGetDir

The requested directory

Where

enumAGetDir can be one of the following values:

 

Name

Value

Description

aGetDirCurrent

0 *

Current working directory

aGetDirApp

1

App directory, ATEasy directory when running from the IDE

aGetDirAppExe

2

App Exe directory

aGetDirATEasy

3

ATEasy directory

aGetDirProgram

4

Programs files directory

aGetDirLog

5

Log files directory

aGetDirDriver

6

Driver files directory

aGetDirDll

7

DLL files directory

aGetDirDlg

8

DLG files directory

aGetDirLastProgram

9

Last program directory

aGetDirSystemRoot

20

System Root folder, for example: "C:\Windows",  similar to %SystemRoot% environment variable (v14/2025)

aGetDirTemp

21

Temp folder, for example: "C:\Users\UserName\AppData\Local\Temp", similar to %Temp% environment variable (v14/2025)

aGetDirUserProfile

22

User Profile folder, for example: "C:\Users\UserName"  similar to %UserProfile% environment variable (v14/2025)

aGetDirPublic

23

Public folder, for example: "C:\Users\Public", similar to %Public% environment variable (v14/2025)

aGetDirProgramData

24

Program Data folder, for example: "C:\ProgramData",  similar to %ProgramData% environment variable (v14/2025)

aGetDirProgramFiles

25

Program Files folder, for example: "C:\Program Files", similar to %ProgramFiles% environment variable (v14/2025)

aGetDirProgramFilesX86

26

Program Files X86 folder, for example: "C:\Program Files(x86)", similar to %ProgramFiles(x86)% environment variable (v14/2025)

Comments

The PRG, LOG, INS, DLL, and DLG directories are provided only for compatibility with ATEasy 2 users.

The function returns the full path of these directories. To use this function to create a file name, append the "\\" and the filename to the returned string.

Example

sLogFileName=GetDir(aGetDirCurrent)+"\\"+"X.LOG"

Print sLogFileName

! if the current directory is c:\ATEasy\ this will print

! C:\ATEASY\X.LOG

 

print GetDir(aGetDirAppExe)

print GetDir(aGetDirApp)

print GetDir(aGetDirATEasy)

print GetDir(aGetDirCurrent)

 

! these will print the following from the IDE:

C:\projects\ATeasy\ABC                >>> EXE dir specified in the project

C:\Projects\ATEasy\ATEasy\Debug       >>> IDE App dir

C:\Program Files\ATEasy               >>> ATEasy product directory

C:\Projects\ATEasy\Examples           >>> current directory

See Also

FileCreate, FileOpen, FilePrint, SaveLog, enumAGetDir