TagExists
Checks if a specific tag is available in the IDEA database.
Compatibility
Available as of IDEA version 9.0
Syntax
TagExists(database as Object, tagName as String) as Boolean
Parameters
database
Object containing the opened database.
tagName
Name of the tag to look for.
Remarks
Returns true if tag is found.
An error is raised if
- database is null
- tagName is null or empty.
Example
Dim SimpleCommands As Object
Dim db As Object
Dim fileName As String
Sub Main
Set SimpleCommands = SmartContext.MacroCommands.SimpleCommands
'Get the name of the database.
fileName = SmartContext.PrimaryInputFile
'Open the database.
Set db = Client.OpenDatabase(fileName)
'Return true if tag "TagName" exists in database.
If SimpleCommands.TagExists(db,"TagName") Then
'Do something with the tagged field
End If
'Close the database.
db.Close
Set db = Nothing
'Release object.
Set SimpleCommands = Nothing
End Sub