Version: ToString

ToString

Converts the value of the current Version object to its equivalent string representation. A specified count indicates the number of components to return.



 Public Function ToString(
	  Optional ByRef FieldCount As Variant ) As String

Parameters

FieldCount
[ByRef] Optional. Variant. The number of components to return. The FieldCount ranges from 0 to 4.

Return Values

String -  The string representation of the values of the major, minor, build, and revision components of the current Version object, each separated by a period character (.'). The FieldCount parameter determines how many components are returned.
FieldCount Return Value
0An empty string ("").
1Major
2Major.Minor
3Major.Minor.Build
4Major.Minor.Build.Revision
For example, if you create Version object using the constructor Version(1,3,5), ToString(2) returns "1.3" and ToString(4) throws an exception.

Exceptions

Exception Condition
ArgumentException FieldCount is less than zero, or more than four.
-or-
FieldCount is more than the number of components defined in the current Version object.

See Also

Project CorLib Overview

Class Version Overview