I want do something like:
for(var i=0; i < 3, i++) {
var file_i = i;
}
and got local variables: file_0 = 0,file_1 = 1, file_2 =2
I’m also want to know how to make it happen in Ruby.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you don’t mind the new variables being global:
But as comments have noted, this is a bad idea. Make these properties of an object:
And then you can read back these properties with:
I’m afraid I don’t know how to do this with Ruby.