Quick bool question

I need to generate a bool value, but apparently it can’t be cast…it is set true or false based upon various calcs…all of these if …else statements pile up…is there a more COMPACT way vto code …i must pass true or false to the final routine which is used for a lot of things

if (motorTime+ reverseTime > 2300)
                                valdidated(false);
                            else
                                valdidated(true);

                            if (valveTime + pumpTime < 75)
                                valdidated(false);
                            else
                                valdidated(true);

                           if (relayTime Time >100)

                                valdidated(false);
                            else
                                valdidated(true);

wanted: validated((bool)(relaytime<=99))…but won’t work…want something compact like this

NOTE these checks are shown together TOGETHER HERE for illustration, they are given in various parts of the program

This is bool
(realytime<=99)

why cast it!

THANKS!!

I did try that originally, but now I see I accidentally did validated(time>>99) rather than validated(time>99)…which led me down the wrong path

time>99 is far different than time>>99 !!!

Could you not do:

validated((motorTime + reverseTime > 2300));

?

[quote]Could you not do:

validated((motorTime + reverseTime > 2300));[/quote]

Yes…I originally accidentally was using >> rather than > and of course it gave a conversion error which threw me off the railroad track