Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 newbie help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RyanHB




PostPosted: Mon May 04, 2009 6:56 pm   Post subject: newbie help

when i type this code:

var Name : string
var Weight : int
var numname : int
numname := 0


loop
put "Enter Name: " ..

get Name

numname := numname + 1

put "Enter Weight: " ..

get Weight





exit when numname := 10

end loop

----------

it highlights exit when numname:=10 saying exit must be boolean type.
Sponsor
Sponsor
Sponsor
sponsor
saltpro15




PostPosted: Mon May 04, 2009 7:11 pm   Post subject: RE:newbie help

a boolean value must be either true or false you want something like this

var check : boolean
if numname = 10 then
check := true
else
check := false
end if
exit when check = true
RyanHB




PostPosted: Mon May 04, 2009 7:25 pm   Post subject: RE:newbie help

Oh ok thanks:D
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: