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

Username:   Password: 
 RegisterRegister   
 What's the difference between = and :=
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Danyn




PostPosted: Tue Dec 03, 2013 9:47 pm   Post subject: What's the difference between = and :=

Not exactly a question that requires code, just looking for some clarification.
Sponsor
Sponsor
Sponsor
sponsor
evildaddy911




PostPosted: Tue Dec 03, 2013 9:53 pm   Post subject: RE:What\'s the difference between = and :=

ok, so '=' is used for comparison; its used in 'if' statements; while ':=' is used for assignment, where you assign values to variables.
for example,
Turing:

x := 5
if x = 5 then

however, the turing compiler will accept '=' in place of ':=', meaning that
Turing:

x = 5
% is equivalent to
x := 5


unfortunately, the reverse is not true.
Turing:

if x := 5 then

will not compile
Raknarg




PostPosted: Wed Dec 04, 2013 1:55 pm   Post subject: RE:What\'s the difference between = and :=

Don't get this confused with other languages.

Java, C and Python (that I know for sure) use = for assignment, and use == for comparisons.
mr.frenchman




PostPosted: Wed Dec 04, 2013 2:34 pm   Post subject: RE:What\'s the difference between = and :=

In pascal and delphi " := "- used for assigning value
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  [ 4 Posts ]
Jump to:   


Style:  
Search: