Home Variable with many values
Reply: 1

Variable with many values

Vincent Published in 2018-02-10 21:08:43Z

Is there a way to make a variable equal to one thing or another? for example:

// var x might be a or b or c

if (x == a || x == b || x == c)
// do this
// neither a, b or c
Marcin Szwarc
Marcin Szwarc Reply to 2018-02-10 21:30:24Z

Variables can have ONE AND ONLY ONE value.

If you want a variable like an array of bools (for example: the dialog window contains buttons 0, 2 and 3, but doesn't contain 1 and 4), you should use bitmasks - see Nina Scholz's answer.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.351125 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO