: tclsh8.5
% info patchlevel
8.5a4
% after -1; puts "That was past."
bad argument "-1": must be cancel, idle, info, or a number
% after 0; puts "This is now."
This is now.
% after 4294967296; puts "This just won't happen."
integer value too large to represent
% after 2147483647; puts "This takes long."
^C
: tclsh8.5
% after 2147483648; puts "That was fast!"
That was fast!
% exit
Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1? This
immediate return does not fit my plans at all. Is this a bug, or am I just
missing some documentation?
--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done
Robert
You could created a loop for the number of whole days, then create a loop
containing an after statement for each whole day.
eg:
for {set l 1} {$l <= 25} {incr l} {
after 86400000 ;# one whole day
}
puts "25 days have passed"
This is very crude. For 25 days, you would be better running from a scheduler,
such as cron.
> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1?
I guess this is because you have 32 bit registers on your system.
Regards,
Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Telephone: (0121) 247 1596
International: 0044 121 247 1596
Email: markhobley at hotpop dot donottypethisbit com
> Kaitzschu <kait...@kaitzschu.cjb.net.nospam.plz.invalid> wrote:
>> % after 4294967296; puts "This just won't happen."
>> integer value too large to represent
>
> You could created a loop for the number of whole days, then create a
> loop containing an after statement for each whole day.
Yes, looks a lot like I need a repeater. At least it won't fire every now
and then, 20 days interval should be enough.
> This is very crude. For 25 days, you would be better running from a
> scheduler, such as cron.
Cron is not an option, this application is running for all those 25 days
(and even more, I recorded 40 days, but then power outage hit me, and
after that 8.5 alphas have been very unstable, crash every fortnight or
less :)
The need for these longish delays, however, arose recently.
>> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1?
>
> I guess this is because you have 32 bit registers on your system.
Don't most people do? .) After reading source there appears to be if
clause for negative numbers to return 0. Apparently these numbers go to
[after] as overflows, get treated as negative ones, and return right away.
This has some issues.
Well, it's wrapper-time!
> Kaitzschu wrote:
>>
>> : tclsh8.5
>> % info patchlevel
>> 8.5a4
>> % after -1; puts "That was past."
>> bad argument "-1": must be cancel, idle, info, or a number
>>
> Something must have changed as I tried the same thing with 8.4.11 and it
> work. By works I mean on the "after -1", it returns the puts statement.
Most likely this,
if (isdigit(UCHAR(argString[0]))) { /* INTL: digit */
since
after [expr {0-1}]; puts "Happened!"
works. Routine checks for intrep first, but "-1" doesn't seem to have it
just yet then, or at least it isn't integer.
Let me present you witha stock answer: Log a bug at SF, and I'll look
into this.
--
73 de ke9tv/2, Kevin
This is definitely a bug.
Tcl should never show a different result on whether an arg
is a specific object (e.g. integer) or its string-rep.
Unless you've done so, already, report it on sf-bugtracker!
[ 1350291 ] [after] overflowing milliseconds
[ 1350293 ] [after] failing to recognize negative number
Sourceforge should craft their bug tracker to work with ELinks, or Debian
should never had switched X11 to X.org, since that truly broke Type5 on my
Sparcstation.
Writing to c.l.t. is just so much easier. Where is ReportTclBug2SF.kit?!
And preferably one usable from console :)