Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
gordanblake
gordanblake's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Using combined strings as istance name
[3 Replies]
09-Apr-2011 08:15 AM
Forum:
Programming Questions
Hi,
being a super noob in programming i was trying to give a class instance a name generated by a for cycle.
now, the problem is that in both the line of code i wrote (line 7 and 8) Processing doesn't read the id as i want to (i.e. q1, q2, q3).
is there a way to tell processing to use a mix of 2 or plus strings as an instance name?
Thank you.
for (int i = 1; i <= 4; i++) {
String letter = "q";
String num = str(i);
String mix = letter+num;
println(mix);
str(q+i).display(); // just read q as istance name don't consider the i
mix.display(); // of course uses the word mix as the id
}
«Prev
Next »
Moderate user : gordanblake
Forum