RenameFieldAt
Renames an IDEA field at a given position.
Compatibility
Available as of IDEA version 9.0
Syntax
RenameFieldAt(database as Object, position as Integer, newFieldName as String, Optional description as String)
Parameters
database
Object containing the opened database.
position
Position of the field for which the field will be renamed.
newFieldName
New name of the field.
description
Only one optional argument: Description.
Remarks
Error is raised if:
- database is null
- newFieldName 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)
'Renames the name of the field at position 2.
SimpleCommands.RenameFieldAt db, 2, "NEWNAME", "My new field description"
'Close the database.
db.Close
Set db = Nothing
'Release object.
Set SimpleCommands = Nothing
End Sub