FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   returning non-void "STUPID QUESTION OF THE DAY"
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: returning non-void "STUPID QUESTION OF THE DAY"  (Read 241 times)
madmerv
Guest
Email
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

WWW Email
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

fluxhavoc WWW
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.
 
Pages: 1 

« Previous topic | Next topic »