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

Home » Public Forums » archive » Re: Help with Nested FOR Loop
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: Help with Nested FOR Loop [message #42040 is a reply to message #42039] Fri, 10 December 2004 13:34 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
coold writes:

> The following code gives me syntax error for the last two endfor
> statements. I am trying to use the nested for loop to print the value
> of x. I have tried &$ on the 6th and 7th while $ on 1 and 2.
> Any help would be appreciated
>
> for i = 0, 20 do begin
> for j = 0, 20 do begin
> for k = 0, 5 do b[0,k] = 0.5^2
> funct_addnumbers, a,b,x ; where x is the result
> print,x
> endfor
> endfor

Slap this code into a file, add another END at the
bottom of the file, name the file "myloop.pro", then
compile the program:

IDL> .compile myloop

Then, to run the loop, type .GO:

IDL> .go

Don't try to build loops at the IDL command line. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Stretching an image
Next Topic: Re: combinatory analysis with restrictions

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

Current Time: Sun Oct 12 17:34:57 PDT 2025

Total time taken to generate the page: 0.95924 seconds