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

Home » Public Forums » archive » Re: Incremental variable names?
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: Incremental variable names? [message #37911 is a reply to message #37903] Mon, 02 February 2004 05:57 Go to previous messageGo to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Jonathan Greenberg wrote:
> Have a question about variable names. Is there any way to create and then
> call variable names that have some incremental value in them, e.g.:
>
> t0
> t1
> t2
>
> Etc... I want to be able to first create and assign a value to tn where n =
> 0 to whatever, and then be able to subsequently call that variable using a
> loop.

Hello,

I'm a bit confused about why you to name the variable incrementally if
what you really want to access them incrementally. It seems to me that
you will not be able to decode the increment of the variable with ease
after you have created it. I would seriously consider using a linked
list (http://www.dfanning.com/documents/programs.html#LINKEDLIST) or
make a variable object that can be stored in a container (which is just
a linked list itself.) Then you simply access the variable in the
order the have been stored.

I was introduced to the latter method when Martin Schultz (where is he,
anyway?) first built a generic object system. I prefer the Martin's
method now, as I can do some spiffy things with the variables without
cluttering up my code.

Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: object graphics question
Next Topic: Re: Virtual Machine Crashes :-(

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

Current Time: Fri Oct 10 13:44:24 PDT 2025

Total time taken to generate the page: 0.80633 seconds