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)
   return value bug? v52 Win2000
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: return value bug? v52 Win2000  (Read 235 times)
fractal


return value bug? v52 Win2000
« on: Jul 11th, 2003, 5:13am »

has anyone else seen received en error 'Methode "valid" must return a value JLS [8.4.5]' where the code does have a return value?  
 
==============CODE================
class pi
{
    pi()
    {
    ;
    }
    boolean valid()
 {
     return 1;
 }
}
 
====================================
 
I need to use a class and maybe P5 gets confused while translating my return values inside the class to whichever underlying java classes it needs.  Anyway, I just wanted to see if maybe my code sucks or this is a temporary P5 "feature."  
 
Um, yes, this *did* come from real code, but I tried to track it down by reducing an if statement where returns made function calls, to just plain constants, and then removed the statement altogether. weird, eh?
 
thanks for any help!
 
benelek

35160983516098 WWW Email
Re: return value bug? v52 Win2000
« Reply #1 on: Jul 11th, 2003, 6:38am »

since the function is of type 'boolean', you have to return either "true" or "false" - the number 1 is not a boolean value.
 
Pages: 1 

« Previous topic | Next topic »