Re: generate unique variable names?

2014-10-08 Thread Nicolas F. via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 02:53:08 UTC, K.K. wrote: On Wednesday, 8 October 2014 at 02:06:28 UTC, Brian Schott wrote: I'm 99% sure you actually want an array or associative array. Something like this maybe? ImageType[string] images; images[format(image%03d, i)] = new

generate unique variable names?

2014-10-07 Thread K.K. via Digitalmars-d-learn
Is there a way to generate variable names using strings? What I'm trying to do in this particular case is use a for loop, to generate variables (then probably put them in an array in the end) that represent images. So the name is pretty much image + the image padding + iterator number. So

Re: generate unique variable names?

2014-10-07 Thread Brian Schott via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 01:16:50 UTC, K.K. wrote: Is there a way to generate variable names using strings? What I'm trying to do in this particular case is use a for loop, to generate variables (then probably put them in an array in the end) that represent images. So the name is pretty

Re: generate unique variable names?

2014-10-07 Thread K.K. via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 02:06:28 UTC, Brian Schott wrote: I'm 99% sure you actually want an array or associative array. Something like this maybe? ImageType[string] images; images[format(image%03d, i)] = new ImagefromFile(userDefinedLocation); oooh okay I see what you mean. Yeah