Re: long subscript... [message #53674] |
Thu, 26 April 2007 09:32 |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Apr 25, 1:17 pm, kostis <kostis...@gmail.com> wrote:
> In the following code j is defined as a 'long' number...
> But the number j*100 as a subscript of x in plots command is not a
> 'long' number...
> causing a problem when the limit is reached..
> How do i fix it??
> How do i define all numbers long?
As other suggested, COMPILE_OPT defint32 is the way to make the
default integer a long, but:
IDL> j = 0L
IDL> help, j * 100
<Expression> LONG = 0
IDL promotes the value of an expression to the type needed to hold the
precision all the operands. So here, because j is a long, the result
is a long.
As David suggested in the other thread, your issue here is probably
with graphics card memory.
Mike
--
www.michaelgalloy.com
|
|
|
Re: long subscript... [message #53678 is a reply to message #53674] |
Thu, 26 April 2007 07:59  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On Apr 25, 2:29 pm, kostis <kostis...@gmail.com> wrote:
> In the following code j is defined as a 'long' number...
> But the number j*100 as a subscript of x in plots command is not a
> 'long' number...
> causing a problem when the limit is reached..
> How do i fix it??
> How do i define all numbers long?
>
> n=100000L
> x=findgen(n)
> y=findgen(n)
> z=findgen(n)
> XInterAnimate, set=[500,500,999]
> for j=1L,998L do begin
> plots, x((j-1)*100:j*100), y((j-1)*100:j*100),
> z((j-1)*100:j*100),/T3D,/DATA
> XInterAnimate, Frame=j
> endfor
> XInterAnimate
>
> Thanx a lot
j*100 is long for me? I'd just replace the () with [] when indicating
subscripts.
|
|
|
Re: long subscript... [message #53684 is a reply to message #53678] |
Thu, 26 April 2007 02:24  |
Maarten[1]
Messages: 176 Registered: November 2005
|
Senior Member |
|
|
On Apr 25, 7:29 pm, kostis <kostis...@gmail.com> wrote:
> In the following code j is defined as a 'long' number...
> But the number j*100 as a subscript of x in plots command is not a
> 'long' number...
> causing a problem when the limit is reached..
> How do i fix it??
> How do i define all numbers long?
either use 100L, or add
compile_opt defint32, strictarr, strictarrsubs
to the start of each function or procedure. You can execute this
command on the command line to have the same effect on interactive
usage. Before you ask, no, there is no equivalent to get all floats to
be double precision numbers.
Maarten
|
|
|
Re: long subscript... [message #53686 is a reply to message #53684] |
Wed, 25 April 2007 21:31  |
Christopher Thom
Messages: 66 Registered: October 2006
|
Member |
|
|
Quoth kostis:
> In the following code j is defined as a 'long' number...
> But the number j*100 as a subscript of x in plots command is not a
> 'long' number...
> causing a problem when the limit is reached..
> How do i fix it??
> How do i define all numbers long?
compile_opt defint32
but a more common statement is
compile_opt idl2
which forces [] brackets for array subscripts.
cheers
chris
|
|
|