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 / [SOLVED] Select case using operators > and

Author
Message
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 16th Jul 2018 03:31 Edited at: 16th Jul 2018 03:31
It's possible to use select case with operators like > and <?

Example:

The author of this post has marked a post as an answer.

Go to answer

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jul 2018 03:57
You'd have to use IF statements for something like that. And if you did, if grid is over 1000 then it would also trigger an event for being over 900 as well.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 16th Jul 2018 04:14
This post has been marked by the post author as the answer.
Yes, that was just an example. I will use IF as you suggested, Phaelax. Thank you!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Jul 2018 11:18
i think u can use a function as condition
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : NVIDIA (390.65) GeForce GTX 1050 Ti : Mac mini OS High Sierra (10.13)
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 16th Jul 2018 12:36
That's very clever, Markus. Thanks!
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Jul 2018 21:16 Edited at: 16th Jul 2018 21:18
If you are using if tests in the function, why use the select? Just use the if tests and skip the select. But agreed, that is cool Markus!



You can also do

TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 16th Jul 2018 23:51
You can do this
IronManhood
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: US
Posted: 17th Jul 2018 09:09
Wow, didn't know any of that..
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 17th Jul 2018 13:55
I had no idea the parenthesis would make the trick. I'll try that! Thank you!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jul 2018 14:18
Quote: "I had no idea the parenthesis would make the trick. "

it works because u put also the select value in and the result from the condition is just true or false.
if you will have a short write style / easily readable you can do this by a own function if it make sense.
(a >= 0 and a < 100)
Between(a, 0 ,100)


AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : NVIDIA (390.65) GeForce GTX 1050 Ti : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2024-11-23 17:48:41
Your offset time is: 2024-11-23 17:48:41