IDEAVersion
Returns the IDEA version as string provided by the IDEA code (usually 4 elements, e. g. "10.1.3.5")
Compatibility
Available as of IDEA version 10.3
Syntax
IDEAVersion
Type
String
Example
Option Explicit
Dim oMC As Object
Dim oSC As Object
Sub Main
On Error GoTo ErrorHandler
Dim SAVersion As String
Dim IDEAVersion As String
Dim text As String
Dim result As Long
Set oMC = SmartContext.MacroCommands
Set oSC = oMC.SimpleCommands
SAVersion = GetSAVersion()
If SAVersion <> "" Then
IDEAVersion = oSC.IDEAVersion
text = "SmartAnalyzer version is " & SAVersion & Chr(13) & "IDEA version is " & IDEAVersion & Chr(13) & Chr(13)
If oSC.TryCompareVersions(SAVersion, IDEAVersion, result) Then
Select Case result
Case -1
text = text & "SmartAnalyzer version is smaller than IDEA version."
Case 1
text = text & "SmartAnalyzer version is greater than IDEA version."
Case 0
text = text & "SmartAnalyzer version and IDEA version are the same."
Case Else
text = text & "Invalid result (" & result & ") received when comparing versions!"
End Select
Else
text = text & "The 2 versions cannot be compared."
End If
Else
text = "SmartAnalyzer version could not be found!"
End If
MsgBox text
Exit Sub
ErrorHandler:
MsgBox "Error: " & err.Description
End Sub 'Main
Function GetSAVersion() As String
On Error GoTo ErrorHandler
GetSAVersion = oSC.SmartAnalyzerVersion
Exit Function
ErrorHandler:
GetSAVersion = ""
End Function