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 / compound condition case statement

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Mar 2019 21:57
It appears that the compound condition case statement doesn't work
puzzler2018
User Banned
Posted: 17th Mar 2019 22:04
Me neither - dammm worst luck

Go back to IFs

Tier 1 Developer
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Mar 2019 22:09 Edited at: 17th Mar 2019 22:13
exactly ^^^^ separate the cases with a comma




in AppGameKit OR is a logical test so..... 2 or 3 = 1
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Mar 2019 22:12 Edited at: 17th Mar 2019 22:15
didn't know the "or" was a thing with case statements

I seem to recall you couldn't use "or" with case statements in c or even c++

well done @bengismo didn't know you could use a comma like that
fubar
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Mar 2019 22:20
Scraggle beat me to it...he deserves the credit...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Mar 2019 22:23 Edited at: 17th Mar 2019 22:24
ok so how do i represent an AND condition? Say > 2 and < 5
The documentation does say "condition" and makes no mention of the commas
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Mar 2019 22:35
The "condition" has to be equal to the select value for that case to be used.

So as below you can use something like case (v>2 and v<5)*v a condition that has a logical test in it but returns the value v if true




you can also use "select 1" then simply have the case as "case (v>2 and v<5)"

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Mar 2019 22:39
Great. Thanks everyone for your help

Login to post a reply

Server time is: 2024-04-25 16:15:00
Your offset time is: 2024-04-25 16:15:00