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 #42042 is a reply to message #42040] Fri, 10 December 2004 13:29 Go to previous message
KM is currently offline  KM
Messages: 29
Registered: October 2004
Junior Member
On Fri, 10 Dec 2004, coold wrote:

> 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
>
> 1 for i = 0, 20 do begin
> 2 for j = 0, 20 do begin
> 3 for k = 0, 5 do b[0,k] = 0.5^2
> 4 funct_addnumbers, a,b,x ; where x is the result
> 5 print,x
> 6 endfor
> 7 endfor

We recommend that you do not try to type such complex stuff with
loops at the command line. Put it in a file and then run the files.

If you don't want to use an extra file, check out the .com command
Better yet, type the above in emacs, highlight it, and then "C-c C-d
C-e" it

However, if you wanted to do it all at the CLI

for i = 0, 20 do begin $
for j = 0, 20 do begin $
for k = 0, 5 do print, k &$
print, "foo" &$
endfor &$
endfor

But please, don't do this.

-k.
[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: Sat Oct 11 23:22:38 PDT 2025

Total time taken to generate the page: 0.16266 seconds