Re: variable start values

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Jason,

----------
> From: Jason Dube <dubetyrant at hotmail.com>
> Subject: variable start values
> 
> 
> Hi,
> Im writing a simple punctuation checker, 
> I get the following message
> when I try to execute this:
> 
>  "capital1 has not been assigned a value"
> 
> function check_for_punc_1(object x)
>   boolean capital1
>   if x[1][1] < 90 then
>     position(2,1)
>     puts(1,"GARBLE: [Sentence is not capitalized...]")
>     capital1=0
>   end if
>     return capital1
> end function

Try please instead:

 function check_for_punc_1(object x)
   boolean capital1
   if x[1][1] < 90 then
     position(2,1)
     puts(1,"GARBLE: [Sentence is not capitalized...]")
     capital1=0
   else         -----<---- new
     capital1=1 -----<---- new 
   end if
     return capital1
 end function

[snipped]

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu