UniqueFileFlatName
Creates a unique name for a database depending on a specific result database type. In contrast to UniqueFileName the location of the audit test's primary input database is not taken into account.
Compatibility
Available as of IDEA version 10.0
Syntax
UniqueFileFlatName(baseName as String, resultType as Integer)
Parameters
baseName
Base name as string without extension and with/without relative path.
resultType
The type of the database. Possible types are:
| Macro Result Type ID | Value | Indicator |
|---|---|---|
|
NOT_A_RESULT |
0 |
<none> (default value) |
|
INTERMEDIATE_RESULT |
2 |
= |
|
FINAL_RESULT |
4 |
- |
|
NO_REGISTRATION |
8 |
~ |
Return Value
Returns a full path on desktop and a relative path on IDEA Server.
Remarks
The method is identical to UniqueFileName with the exception of the following scenario:
- baseName has no relative path (i.e. it is only a database name)
- The primary database of the audit test is located in a sub-folder of the IDEA project.
In this case the method's result is located within the IDEA project, whereas UniqueFileName returns a path within the subfolder of the primary database of the audit test.
That means, if no path is specified for baseName, UniqueFileName always places the result in the subfolder of the audit test's primary database, whereas the result of UniqueFileFlatName is independent of the location of the primary database.
If a database name already exists in the active IDEA project, the returned path has a numeric suffix (index) at the end of the name before the database's extension; the count starts with 2.
An error is raised if the specific path does not exist or the result type is not valid.
All result databases created by an audit test shall contain the unique audit test ID followed by an indicator which tells the user or the audit test developer what kind of result a file it is. The audit test ID has to be taken from the hidden property "Audit test ID".
Example
The name shall be Chart of Accounts. The audit test ID is 10116. IDEA is used as ASCII version (extension = .IMD). The file will be created the first time and is not available in the current folder. Based on this information the following file names will be created.
| Command | Resulting Database Name |
|---|---|
|
UniqueFileName ("Chart of Accounts") |
Chart of Accounts.imd |
|
UniqueFileName ("Chart of Accounts", NOT_A_RESULT) |
Chart of Accounts.imd |
|
UniqueFileName ("Chart of Accounts", INTERMEDIATE_RESULT) |
10116=Chart of Accounts.imd |
|
UniqueFileName ("Chart of Accounts", FINAL_RESULT) |
10116-Chart of Accounts.imd |
|
UniqueFileName ("Chart of Accounts", NO_REGISTRATION) |
10116~Chart of Accounts.imd |
In case the macro developer has not defined an audit test ID property value for an audit test, only the name will be taken into account. The result indicator will be ignored in this case.