|
Author |
Topic: returning non-void "STUPID QUESTION OF THE DAY" (Read 241 times) |
|
madmerv Guest
|
returning non-void "STUPID QUESTION OF THE DAY"
« on: Nov 26th, 2003, 5:22pm » |
|
So I've done this a couple times and I've got the same error; I forget how I worked around it, but my question is, syntactically, why is this not cool: float testFloatSyntax( float somefloat ) { return somefloat; } void setup() { } void loop() { }
|
« Last Edit: Nov 26th, 2003, 6:07pm by madmerv » |
|
|
|
|
mohn
|
Re: returning non-void "STUPID QUESTION OF THE DAY
« Reply #1 on: Nov 26th, 2003, 6:40pm » |
|
what error are you getting? it compiles fine for me: float somefloattest (float somefloat) { return somefloat; } void setup() { size(5,5); } void loop(){ float n=4; somefloattest(n); print(n); } or even: float somefloattest (float somefloat) { return somefloat; } void setup() { size(5,5); } void loop(){ // float n=4; // somefloattest(n); // print(n); }
|
|
|
|
mflux
|
Re: returning non-void "STUPID QUESTION OF THE DAY
« Reply #2 on: Nov 26th, 2003, 10:25pm » |
|
Processing can be picky about where you throw spaces. For example your argument float somefloat: float testFloatSyntax( float somefloat ) written with those padded spaces might cause things to go haywire. Try typing it (my preferred way) float testFloatSyntax(float somefloat) without spaces. It should work.
|
|
|
|
|