09/07/2011 05:46 a.m.
BITXOR is a useful operator if you want to generate alternating true/false values. If the value is undefined or zero, the following example will return 1 otherwise it will return one. A practical use would be to apply alternating row colours using an array of two elements with either a CSS class name or hex colour value. Since Mivascript arrays are 1 based, it is necessary to add one to the result of the BITXOR to get the array index.
<mvassignname="l.rowclass"value="{miva_array_deserialize('row1,row2'}>"<mvforcount="{ 10 }>"<mvassignname="l.alternate"value="{l.alternate BITXOR 1}>"<trclass="{l.rowclass[l.alternate + 1]}>"<td>Some text</td></tr></mvfor>