Version number

#1
Hi Rex,

I just stumbled overe the version number. The latest shows here as

9,02.152

AFAIK the first separator is localized, so the comma shown here would be
a point in the US. Is the second one always a point, or does it show as
comma in the US?

It seems to me that this makes version comparison in batches (that's
where I stumbled upon this) so much harder to port to other countries.

Mit freundlichem Gruß,

Klaus Meinhard
 
#2
K_Meinhard wrote:
| Hi Rex,
|
| I just stumbled overe the version number. The latest shows here as
|
| 9,02.152
|
| AFAIK the first separator is localized, so the comma shown here would
| be
| a point in the US. Is the second one always a point, or does it show
| as
| comma in the US?
|
| It seems to me that this makes version comparison in batches (that's
| where I stumbled upon this) so much harder to port to other countries.

The %@verinfo[] function seems to report values independently of the
setdos/g settings. This is the list of all non-empty values for files in the
TCMD distribution, identical for comma and period as decimal separator:

2, 4, 0, 1 Bchild.dll
9.02.152 English.dll
6.1.0.3022 ipworks6.dll
6.2.0.3022 ipwssl6.dll
9.02.152 takecmd.dll
9.02.152 tcc.exe
9.02.152 tcmd.exe
4.4.0.0 WiFiMan.dll

Note the field separators in Bchild.dll's string!

Similarly, the VER command reports for TCC.EXE are identical, but notice the
WinXP(SP3) report:

DecimalChar|VER report
-----------+-----------------------------------------------
period |TCC 9.02.152 Windows XP [Version 5.1.2600]
comma |TCC 9.02.152 Windows XP [Version 5.1,2600]

-----------+-----------------------------------------------

Only the _4VER variable reports an ostensibly decimal number. Because it is
a number, the conditional expression "%_ver GT 6" is a valid comparison
regardless of the value of the DecimalChar directive; version 6.00 (6,00 in
German) would be false, 6.01 (6,01 in German) true.

Try the function

function version_string=`%@verinfo[%_cmdspec]`

or put into TCSTART.BTM the command

set _4ver=%@verinfo[%_cmdspec]

which would override the internal variable _4ver.
--
HTH, Steve
 
#3
K_Meinhard wrote:
| Hi Rex,
|
| I just stumbled overe the version number. The latest shows here as
|
| 9,02.152
|
| AFAIK the first separator is localized, so the comma shown here would
| be
| a point in the US. Is the second one always a point, or does it show
| as
| comma in the US?
|
| It seems to me that this makes version comparison in batches (that's
| where I stumbled upon this) so much harder to port to other countries.

The %@verinfo[] function seems to report values independently of the
setdos/g settings. This is the list of all non-empty values for files in the
TCMD distribution, identical for comma and period as decimal separator:

2, 4, 0, 1 Bchild.dll
9.02.152 English.dll
6.1.0.3022 ipworks6.dll
6.2.0.3022 ipwssl6.dll
9.02.152 takecmd.dll
9.02.152 tcc.exe
9.02.152 tcmd.exe
4.4.0.0 WiFiMan.dll

Note the field separators in Bchild.dll's string!

Similarly, the VER command reports for TCC.EXE are identical, but notice the
WinXP(SP3) report:

DecimalChar|VER report
-----------+-----------------------------------------------
period |TCC 9.02.152 Windows XP [Version 5.1.2600]
comma |TCC 9.02.152 Windows XP [Version 5.1,2600]

-----------+-----------------------------------------------

Only the _4VER variable reports an ostensibly decimal number. Because it is
a number, the conditional expression "%_ver GT 6" is a valid comparison
regardless of the value of the DecimalChar directive; version 6.00 (6,00 in
German) would be false, 6.01 (6,01 in German) true.

Try the function

function version_string=`%@verinfo[%_cmdspec]`

or put into TCSTART.BTM the command

set _4ver=%@verinfo[%_cmdspec]

which would override the internal variable _4ver.
--
HTH, Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,532
94
#4
K_Meinhard wrote:


> I just stumbled overe the version number. The latest shows here as
>
> 9,02.152
>
> AFAIK the first separator is localized, so the comma shown here would be
> a point in the US. Is the second one always a point, or does it show as
> comma in the US?
>
> It seems to me that this makes version comparison in batches (that's
> where I stumbled upon this) so much harder to port to other countries.
The version is displayed in a dozen ways and places -- which one are you
referring to?

Rex Conn
JP Software
 
#5
Rex,


>
> I just stumbled overe the version number. The latest shows
> here as
> >
> > 9,02.152
> >
> > AFAIK the first separator is localized, so the comma shown here
> > would be a point in the US. Is the second one always a point, or
> > does it show as comma in the US?
> >
> > It seems to me that this makes version comparison in batches (that's
> > where I stumbled upon this) so much harder to port to other
> > countries.
>
>
> The version is displayed in a dozen ways and places -- which one are
> you referring to?
VER, %_4ver

Mit freundlichem Gruß,

Klaus Meinhard
 

rconn

Administrator
Staff member
May 14, 2008
10,532
94
#6
K_Meinhard wrote:


>
> Quote:
> >
> Quote:
> > I just stumbled overe the version number. The latest shows
> > here as
> > >
> > > 9,02.152
> > >
> > > AFAIK the first separator is localized, so the comma shown here
> > > would be a point in the US. Is the second one always a point, or
> > > does it show as comma in the US?
> > >
> > > It seems to me that this makes version comparison in batches (that's
> > > where I stumbled upon this) so much harder to port to other
> > > countries.
> >
>
> >
> > The version is displayed in a dozen ways and places -- which one are
> > you referring to?
>
> VER, %_4ver
You're using VER for comparisons??

I'm *extremely* reluctant to change something that has behaved this way
for the last 15 years. It would certainly break a LOT of batch files,
and since you're the only person that's ever requested it, the risk to
reward ratio doesn't seem attractive.

Rex Conn
JP Software
 
#7
JP Software Forums" <[email protected]>; "rconn wrote:



> You're using VER for comparisons??
No, I stumbled over this (%_4ver) in someone else's batch, which didn't
work here with, where the comma is the decimal divider


> I'm *extremely* reluctant to change something that has behaved this
> way
> for the last 15 years. It would certainly break a LOT of batch files,
> and since you're the only person that's ever requested it, the risk to
> reward ratio doesn't seem attractive.
Okay. How many Europeans are around here?

Mit freundlichem Gruß,

Klaus Meinhard
 

rconn

Administrator
Staff member
May 14, 2008
10,532
94
#8
K_Meinhard wrote:

> JP Software Forums" ; "rconn wrote:
>
> Quote:
> > You're using VER for comparisons??
>
> No, I stumbled over this (%_4ver) in someone else's batch, which didn't
> work here with, where the comma is the decimal divider
>
>
> Quote:
> > I'm *extremely* reluctant to change something that has behaved this
> > way
> > for the last 15 years. It would certainly break a LOT of batch files,
> > and since you're the only person that's ever requested it, the risk to
> > reward ratio doesn't seem attractive.
>
> Okay. How many Europeans are around here?
Quite a few. But you're still the only person that's ever asked for it,
and it would still break a lot of existing batch files!

Rex Conn
JP Software
 
#9
JP Software Forums" <[email protected]>; "rconn wrote:
| K_Meinhard wrote:
|
|
> JP Software Forums" ; "rconn wrote:
||
|| Quote:
|| > You're using VER for comparisons??
||
|| No, I stumbled over this (%_4ver) in someone else's batch, which
|| didn't work here with, where the comma is the decimal divider
||
||
|| Quote:
|| > I'm *extremely* reluctant to change something that has behaved
|| this > way
|| > for the last 15 years. It would certainly break a LOT of batch
|| files, > and since you're the only person that's ever requested it,
|| the risk to > reward ratio doesn't seem attractive.
||
|| Okay. How many Europeans are around here?
|
|
| Quite a few. But you're still the only person that's ever asked for
| it,
| and it would still break a lot of existing batch files!

However, a new internal variable, e.g. _CPVER (i.e., Command Processor
VERsion) would not break existing programs, and could satisfy the need for
porting invariant version string. I would propose a format with fixed
subfield widths, e.g., 09.02.152 for the latest released build of TCC (and
TCMD).
--
Steve