Re: Large widget identifiers [message #33171 is a reply to message #33169] |
Fri, 13 December 2002 10:41   |
David Burridge
Messages: 33 Registered: January 1998
|
Member |
|
|
Hi Ian,
I'm running IDL 5.5 on Windows XP and I see the problem too. Your example
numbers were too low for me though, as your example only goes up to 50,000
and the error is at 65,000. I did this:
PRO widget_test
CATCH, error
IF (error NE 0) THEN BEGIN
CATCH, /CANCEL
PRINT, 'Error with base ID transition:', lastB, ' to ', Base
RETURN
ENDIF
FOR J=0L, 70000L DO BEGIN
Base=WIDGET_BASE()
WIDGET_CONTROL, Base, /DESTROY
lastB = base
ENDFOR
END
And got the results:
IDL> widget_test
Error with base ID transition: 65535 to 0
Looks like it's getting converted to an unsigned short somewhere! Not sure
waht the fix is, though. Are you sure it matters? As I'm sure you know, IDL
allocates pretty much sequentially in my experience, so provided you never
have 65536 active widgets you never hit a problem ... do you?
Cheers,
Dave
David Burridge
Burridge Computing
18 The Green South
Warborough
Oxon
OX10 7DN
Tel: 01865 858279
Mobile: 0780 244 1748
Email: davidb@burridgecomputing.co.uk
"Ian Dean" <Ian.d.dean@baesystems.com> wrote in message
news:3df9bce2$1@baen1673807.greenlnk.net...
> Hi,
> Has anyone come across widget IDs "wrapping" when they reach a short
int
> limit (65535)?
>
> We have a run-time IDL program that is running continuously for
days/weeks.
> During this time several runs of data are processed. Each run requires
> approximately 400 widgets. However, without wishing to exit the software,
> the runs are performed within one program.
>
> The problem occurrs when the widget ID reaches 65535, the next widget to
be
> created is 0, not 65536. This looks like a short int problem, but IDs are
> supposed to be long int.
>
> Is there a way under program control to reset the widget ID back to 1 at
the
> beginning of a run?
> I realise using the development environment .reset achieves this, but that
> cannot be used in a running program.
>
> This occurrs on IDL PC versions 5.2-5.5. However, it does not happen on
> OpenVMS versions.
>
> The following lines will cause the error to occur:-
>
> FOR J=0L, 50000L DO BEGIN
> Base=WIDGET_BASE()
> WIDGET_CONTROL, Base, /DESTROY
> ENDFOR
>
> Any suggestions would be welcome
> Regards,
> Ian
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.404 / Virus Database: 228 - Release Date: 15/10/2002
|
|
|