If/Else Statements Thread last updated on 2003-11-25 23:19:04

Posted by member 700 on 2003-11-25 02:32:17

Does litestep support the comparison of variables.. ie:
IF $scheme$ = blue
BackgroundColor 000000
ENDIF


This doesn't work, but is there a way to write it so that it will?

Posted by member 12798 on 2003-11-25 05:33:13 link

mzscript can compare values

Posted by member 71746 on 2003-11-25 05:57:11 link

If you don't want to use mzScript you can achieve your goal by defining a variable for each color scheme.

BlueScheme true
RedScheme false
YellowScheme false
GreenScheme false

IF BlueScheme
BackgroundColor 000000
ENDIF
IF RedScheme
BackgroundColor 0a0301
ENDIF
IF YellowScheme
BackgroundColor 4a4341
ENDIF
IF GreenScheme
BackgroundColor 00f100
ENDIF


If you only have 2 color schemes it's even easier...

BlueScheme true
RedScheme false

IF BlueScheme
BackgroundColor 000000
ELSE
BackgroundColor 0a0301
ENDIF


...of course I'd recommend using mzScript anyway as once you get your head wrapped around how to use it, suddenly you have SOOOOOO many more things you can do with your theme :)

Posted by member 99 on 2003-11-25 12:07:06 link

Or split all the color-specific definitions into separate files and use
include "$ConfigDir$colors-$scheme$.rc"

and have colors-blue.rc, colors-red.rc, etc.

Posted by member 700 on 2003-11-25 23:19:04 link

Thanks for the response guys. I got it.