Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
atrowbri
atrowbri's Profile
1
Posts
0
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
nf() does not work/works strangely in a conditional?
[1 Reply]
16-Oct-2010 02:13 PM
Forum:
Programming Questions
Processing 1.2.1
I have not used nf() before but this seems like it should work:
String frame1;
int mill1 = 2;
if(mill1 < 10) {
frame1 = nf(mill1, 2);
}
println(frame1);
However, it returns "The local variable frame1 may not have initialized"
What is strange is that this works:
String frame1;
int mill1 = 2;
if(mill1 < 10) {
frame1 = nf(mill1, 2);
} else {
frame1 = Integer.toString(mill1);
}
It returns, as expected: 02
Am I misunderstanding nf() or is this a bug?
«Prev
Next »
Moderate user : atrowbri
Forum