CasewareDocs

UniqueFileName

Creates a unique name for a database depending on a specific result file type. In contrast to UniqueFileFlatName the audit test's primary input file's folder is taken into account (see parameter baseName).

Compatibility

Available as of IDEA version 9.0

Syntax

UniqueFileName(baseName as String, resultType as Integer)

Parameters

baseName

Base name as string without extension and with/without relative path. If no path is specified the result is always placed along the audit test's primary input file.

resultType

The type of the database. Possible types are:

Possible result types
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

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.

Created file names
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.

UniqueFileName | Caseware Docs