[Tutorial] Using the ternary operator :?
#3

Taken from Texture Studio.

Code:
format(optline, sizeof(optline), "{FFFF00}Text: %s\n{FFFF00}Object Note: %s\n{FFFF00}Model Info: %s\n{FFFF00}Group ID: %s\n{FFFF00}Grouped Text: %s\n{FFFF00}Always Show New Objects: %s\n",
                (TextOption[tShowText] ? ("{00AA00}Enabled") : ("{FF3000}Disabled")),
                (TextOption[tShowNote] ? ("{00AA00}Enabled") : ("{FF3000}Disabled")),
                (TextOption[tShowModel] ? ("{00AA00}Enabled") : ("{FF3000}Disabled")),
                (TextOption[tShowGroup] ? ("{00AA00}Enabled") : ("{FF3000}Disabled")),
                (TextOption[tShowGrouped] ? ("{00AA00}Enabled") : ("{FF3000}Disabled")),
                (TextOption[tAlwaysShowNew] ? ("{00AA00}Enabled") : ("{FF3000}Disabled"))
I found it useful in function parameters maybe Y_Less has a better way to do this? At any rate this is important and your tutorial should cover it.
Reply


Messages In This Thread
Using the ternary operator :? - by faxxe - 23.01.2019, 14:35
Re: Using the ternary operator :? - by serqq - 23.01.2019, 14:43
Re: Using the ternary operator :? - by Pottus - 24.01.2019, 23:04

Forum Jump:


Users browsing this thread: 1 Guest(s)