On 18 Jan, David Mannan wrote:
Greetings TCL World;
I've been having a problem with variables set by the system "date" command
whenever the day of the month/year is "008" or "009". This has popped up
several
times before, and is easy enough to patch around - but now it has moved to
"018".
Has anyone seen this before, and more importantly does anyone know a fix
for
it.
What I'm using: HPUX 10.20
VTcl version: 1.20
What I'm doing:
global ExpireDate;
set ExpireDate [exec date +%j]
set bob [expr $ExpireDate + 90]
if {$bob = 365} { set ExpireDate [expr $bob - 365 ]
} else { set ExpireDate $bob }
What it says:
Error in startup script: syntax error in expression "018 + 90"
while executing
"expr $ExpireDate + 90"
(procedure "init" line 28)
invoked from within
"init $argc $argv"
(file "/opt/a7tools/ListManager/Scripts/listmanager.tcl" line 167)
This error only occurred when the day of the month, or day of year
is 08 09. Today it popped up again. I have worked around this by
setting the variable like this:
set ExpireDate {8}
but what I would like to know is why this happens and how to fix it.
And now that it is happening on "018". My concern is, that I will have to
set conditions for every day that ends in a 8 or 9.
Any help would be greatly appreciated.
Well, take a look at the Tcl FAQ. There are workarounds for this
available. The problem is that 0x is interpreted as octal an in octal
notation, 8 and 9 are invalid numbers.
L
--
Penguin Power!
mailto:[EMAIL PROTECTED]
URL: http://www.geocities.com/Heartland/Pointe/5248/
---
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).