-
XML related
Hello,
May be instead of original XML Q (asked here before thinking a bit), I'll ask another one.
I have to add a constant which has max value lets say :
const unsigned short A1_MAX = 100;
And use the same const to check the invalids, I guess I can check something like if the value is A1_MAX+1..Or is it better to define
const unsigned short A1_INVALID = A1_INVALID+1;
to look neat in the code ? Sorry just asking in terms of neatness and tidiness of code..
Thanks a lot
Stay safe
pdk
-
Re: XML related
I'd set the max allowed/valid value as
Code:
#define A1_MAX_VALID_VALUE (100)
However it is just up to you... ;)
-
Re: XML related
Quote:
if the value is A1_MAX+1
Are you checking for < A1_MAX + 1 ? If so, you can just check for <= A1_MAX
-
Re: XML related
Thanks a lot kaud :), yes I can do that
-
Re: XML related
:) , thanks a lot for responding, I know I should do some home work before posting here :)