This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Use of Period In Conditional?

This is a basic question, but I'm hoping someone can help decipher this line of code for me. I can't find a reference anywhere to what the period in this statement does. I assume by the setup that it is some sort of conditional, but would appreciate any further info. Is it Keil specific?

Counter[CounterInstance].Output = FALSE

Parents
  • We started with

    Counter[CounterInstance].Output = FALSE

    One thing to note is that 'C' (unlike Pascal) does not have a specific "boolean" type - and, therefore, "True" and "False" are not part of the language.

    'C' treats zero as "False", and any other value as "True"

    Thus,
    if( something == TRUE )
    is likely to give unexpected results...

    (Of course, Keil C51 provides the bit keyword extension - and a bit variable can only take one of two values...)

Reply
  • We started with

    Counter[CounterInstance].Output = FALSE

    One thing to note is that 'C' (unlike Pascal) does not have a specific "boolean" type - and, therefore, "True" and "False" are not part of the language.

    'C' treats zero as "False", and any other value as "True"

    Thus,
    if( something == TRUE )
    is likely to give unexpected results...

    (Of course, Keil C51 provides the bit keyword extension - and a bit variable can only take one of two values...)

Children