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

Home » Public Forums » archive » name a variable with number
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: name a variable with number [message #87465 is a reply to message #87464] Tue, 04 February 2014 11:51 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
rjp23@le.ac.uk writes:

> How I use it is slightly different to the OP, maybe hence the confusion. I don't so much use it to split up data but to treat data from various sources the same way. It's pretty much the opposite of having hard-coded variable names.
>
> e.g. It's normally when I have data in the same format from various different sources (usually different model runs) which I want to do the same thing to. Rather than have a chunk of code for each data source, to do the same thing to modelA, modelB, modelC, etc I just use execute to make thisModel=modelA within a loop and then act on each in turn.
>
> That probably doesn't make any more sense though ;-)

Well, not to me, it doesn't. ;-)

In a loop like this, when I want clarity, I usually do something like
this. Is this what you mean?

FOR j=0,n DO BEGIN
thisModel = theModels[j]
DoSomethingWith, thisModel
....
ENDFOR

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: accessing IDL internal (aka "built-in") routines
Next Topic: Error using data structures while reading ASCII file with different data types

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

Current Time: Wed Oct 08 17:28:01 PDT 2025

Total time taken to generate the page: 0.00373 seconds