So about an OR operator...

Discussion in 'CHYOA General' started by Grantley, Oct 19, 2019.

  1. Grantley

    Grantley Virgin

    It seems that there isn't one for conditional formatting, such as to make {if@ A=True or B=True}Conditional text{endif}. Am I missing it? If there isn't one, is there plans to add one in?
     
    Dansak likes this.
  2. gene.sis

    gene.sis CHYOA Guru

    Right now, there is no way to do that. (The Formula parser might allow a way to do that.)

    At the moment, you can only use 2 separate statements with similar content though that is not practical if [Conditional text AB] is a lot of content.

    Code:
    {if@ A=True}[Conditional text AB]{endif}{if B=True}[Conditional text AB]{endif}
    or
    Code:
    {if@ A=True}[Conditional text AB]{elseif B=True}[Conditional text AB]{endif}
    Currently, there is no naming convention for variables except the suggestion not to use braces.

    For that reason, it isn't possible to distinguish if the variable in your example is "A" or "A=True or B"

    Before such a functionality could be implemented, we would need some naming convention for variables. If such a naming convention would prohibit the use of "=", "<", ">", and maybe even "!", implementing simply AND and OR would be possible and comparing variables with each other would be possible within the chapter text. Using two additional signs for brackets would even allow more complex structures.

    (The only way I can imagine right now would be something like
    Code:
    {ifor@ A=True}{B=True}[Conditional text AB]{endif}
    or
    Code:
    {if@ A=True}{orif B=True}[Conditional text AB]{endif}
    but both of them feel kind of awkward)