Click to See Complete Forum and Search --> : Usually, how do you define a version number?


monkey3
December 26th, 2004, 07:15 AM
Usually, how do you define a version number?
a float, a double or an integer?

monkey3
December 26th, 2004, 07:15 AM
by the way, for a data file.

NoHero
December 26th, 2004, 07:22 AM
For data file? I introduce a small header that identifies the file. For example if I use a XML file:


<header>
<version type="String">"1.0.01 Beta"</version>
</header>


Benefits of using strings: You can add additional information just like "Beta" or "Service Pack 2".
But they take more space and its recommended to place the length of the string somewhere.
Benefits of Integers: They have a fixed size you don't neen an indicator that specifies the length, but you cannot add additional information.

A good mix of both is: You use an integer to save the version number, and an optional string to specify additional data. That's how the windows API function GetVersionEx does.