Convert 32Bit encoded Version Number to String

I want to display the Version Number of ChartDirector. The ChartDirector Description says:

I’ve tried many ways, but i can’t simply get the Major & Minor Version from this 32Bit encoded Version Value displayed… :confused:

Something like this maybe:

Dim version As New xojo.Core.MutableMemoryBlock(4)
version.Int32Value(0) = ChartDirectorVersionInteger ' 168493061
Dim major As Integer = version.Int8Value(3)
Dim minor As Integer = version.Int8Value(2)
Dim build As Integer = version.Int16Value(0)

and my version:

dim v as integer = CDBaseChartMBS.getVersion

[code] dim v1 as integer = Bitwise.BitAnd( Bitwise.ShiftRight(v, 24), 255)
dim v2 as integer = Bitwise.BitAnd( Bitwise.ShiftRight(v, 16), 255)
dim v3 as integer = Bitwise.BitAnd( v, 65535)

MsgBox str(v1)+"."+str(V2)+"."+str(V3)[/code]

Thank you @Paul Lefebvre and @Christian Schmitz !
Because both work, i mark the first answer as Answer and use Christians in my App. I hope it’s ok Christian. :wink:

I don’T mind. I just got a new snippet to put into documentation for the next client asking.