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

Home » Public Forums » archive » Re: Empty FOREACH 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: Empty FOREACH loop [message #75101] Tue, 15 February 2011 06:14 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 2/14/11 8:08 pm, Paulo Penteado wrote:
>
> I also get the temporary variables stuff, and agree that things like
>
> foreach el,!null do print,el
> foreach el,[] do print,el
> foreach el,{} do print,el
>
> Should all do nothing, with no errors.
>
> But if foreach is given a named variable that is !null it does nothing
> as expected:
>
> IDL> n=!null
> IDL> foreach el,n do print,el

Even more interesting:

IDL> print, !version
{ x86_64 darwin unix Mac OS X 8.0.1 Oct 5 2010 64 64}
IDL> groups = !null
IDL> foreach g, groups do help, g

But:

IDL> print, !version
{ x86_64 linux unix linux 8.0 Jun 18 2010 64 64}
IDL> groups = !null
IDL> foreach g, groups do help, g
% Variable is undefined: GROUPS.
% Execution halted at: $MAIN$

This must be a fix in 8.0.1. I will do some more research, but sheds
some light on the original situation that was causing me some problems
debugging.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: dialog_pickfile crashing IDLDE
Next Topic: Pointer and structure question

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

Current Time: Fri Oct 10 07:25:47 PDT 2025

Total time taken to generate the page: 0.71878 seconds