R
Richard Harris
I was wondering if it is possible to create multiple objects within
loops, for example;
4.times do
#first loop: a = Object.new
#second loop: b = Object.new etc
end
Also can you use the value of an array or hash as the name for an
object? e.g.
#array[1] has the value "a", create a new object with the name "a"
#e.g. a = Object.new
Whatever I try doesn't seem to work so I don't know if there is any way
of doing it.
Many thanks for any help
Richard
loops, for example;
4.times do
#first loop: a = Object.new
#second loop: b = Object.new etc
end
Also can you use the value of an array or hash as the name for an
object? e.g.
#array[1] has the value "a", create a new object with the name "a"
#e.g. a = Object.new
Whatever I try doesn't seem to work so I don't know if there is any way
of doing it.
Many thanks for any help
Richard