Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Multiple results from an assignment assigns NONE of the values (ie a=b=c)

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2017 06:06
Is this functionality supposed to work? The compiler doesn't flag anything and none of the values are set.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 11th Jul 2017 07:30 Edited at: 11th Jul 2017 07:42
after o= the compiler is expecting an assignment so treats t=n as a evaluation, as no actual evaluation is taking place 0 is the result, my theory here is that method is not supported but the compiler is missing the error.

Edit: what was the result you was expecting? (o = t = n) all variables = 50? (o = t : t = n)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2017 07:46
i was expecting an error or all values = 50
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 11th Jul 2017 07:50
That is working exactly as I would expect it to.
If you do this:

... you can see what is happening.

The first print is 'asking' does o = t? If it does then print the boolean result, in this case 1 for TRUE, yes o does = t
The second print is 'asking' are o, t and n all equal? In this case the answer is no or FALSE so 0 is printed.

I'm not sure what you are hoping will happen, perhaps you are trying to set o and t to the same values as n?
If that is the case you will need to assign both variable separately.
AGK V2 user - Tier 1 (mostly)

Login to post a reply

Server time is: 2024-11-24 11:58:04
Your offset time is: 2024-11-24 11:58:04