comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to solve this problem?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to solve this problem? [message #34752 is a reply to message #34723] Thu, 10 April 2003 20:39 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"tomson" <tom2959@21cn.com> wrote in message
news:b75cmt$1ebn$1@mail.cn99.com...
> for i=0,n_elements(y)-1 do begin
> .......
> endfor
>
>
> ERROR MESSAGE:
> Loop limit expression too large for loop variable type.
> <LONG ( 60214)>.
>
> But my program cannot do without that loop.

Change it to

for i=0L,n_elements(y)-1 do ...

or add the following declaration to the beginning of your code

compile_opt DEFINT32

When you set i to 0 at the beginning of the loop, this makes i a short
(16-bit) integer *unless* you explicitly specify a long integer (0L) or you
tell IDL that you want your default integer type to be long (32-bit). Short
integers can't go past 32767

---
--

Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NetCDF I/O problems
Next Topic: socket generated event

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:31:35 PDT 2025

Total time taken to generate the page: 1.92035 seconds