forloops [message #20083] |
Wed, 17 May 2000 00:00  |
Hamid Kohen
Messages: 5 Registered: March 2000
|
Junior Member |
|
|
Hi,
I hate using forloops; does anyone know a better way of implementing the
following code without forloops?
Thanks in advance
for column = 0, size1(1) -1 do begin
for row = 0, size1(2) -1 do begin ;
print, '-------------------------'
print, b
end
end
|
|
|
Re: forloops [message #20170 is a reply to message #20083] |
Thu, 18 May 2000 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
From way of Hamid wrote:
>
> Hi,
>
> I hate using forloops; does anyone know a better way of implementing the
> following code without forloops?
>
> Thanks in advance
>
> for column = 0, size1(1) -1 do begin
> for row = 0, size1(2) -1 do begin ;
> print, '-------------------------'
> print, b
> end
Sure.
print, rebin( b, size1(2) -1, size1(1) -1 )
All your code above does is print b over and over again - why clutter it
all up with the '----------------' string?? :o)
paulv
p.s. apologies for the frivolity, but it's not coffee-time yet....sigh.
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|