Pages:
Actions
  • #1 by armarni on 30 Oct 2017
  • Hi Everyone

    Could anyone explain this:

    when is a square bracket is appropriate? [   ]
    when is a rounded bracket appropriate?  (   )
    Are wiggly brackets ever appropriate?    {   }

    The reason I ask is I just tried a formula for selections form contains certain characters, and using round brackets the trigger didn't fire, but using square brackets it did. In the forum people seem to use different types indiscriminately, and I couldn't seem to find a definitive answer.

    Up to now I have always used round brackets, and I just want to find out if I've used them inappropriately.

    Thanks
  • #2 by LarpHager on 30 Oct 2017
  • are you putting a square bracket in a round hole ???

    :) :)

    Larp
    • LarpHager
  • #3 by armarni on 30 Oct 2017
  • Hi Larp

    If feels like that sometimes!

    I was just wondering if there's some rule when to use different ones, that's all :)
  • #4 by Oxa (WellDoneSoft) on 31 Oct 2017
  • Hello!

    You only use square brackets in the "Text" field of following trigger actions:

    - send email;
    - send text to mobile;
    - write to action log;
    - write to a file.

    You use the brackets to separate trigger variables from the rest of the text, thus letting the program know that you want to parse them and replace for their values. E.g.:

    Selection's Back Price is [back_price]

    This will produce something like:

    Selection's Back Price is 5.0

    If you do not include the variable name in brackets, the text will be like this:

    Selection's Back Price is back_price

    You never use either square or wiggly brackets anywhere else. The wiggly brackets are used in the manual to denote a part of the variable that needs to be replaced with an actual value, e.g.

    r_{number}_ - the {number} here must be replace with 1, 2, 3 ... etc.

    Hope that clears it up.
  • #5 by armarni on 31 Oct 2017
  • Thanks for the detailed explanation Oxa, but that doesn't seem to explain why when I entered selections Form contains sequence (123)$ the trigger didn't fire, but when I entered selections Form contains sequence [123]$ then it did.

    To clarify, using round brackets () didn't work, but using square brackets [] did. I cant see from your explanation why that happened. Any clues?


  • #6 by armarni on 01 Nov 2017
  • I've uploaded a simple trigger as an example:

    The same block is repeated, and the only difference is that one uses round brackets (betting £10) and the other one square brackets (betting £20)

    Only the bet with the square brackets fires.

    I'm running the latest build from the announcements page 8.5.1.2

  • #7 by Oxa (WellDoneSoft) on 01 Nov 2017
  • Quote
    but that doesn't seem to explain why when I entered selections Form contains sequence (123)$ the trigger didn't fire, but when I entered selections Form contains sequence [123]$ then it did.

    Oh, I'm sorry, how could I forget. Yes, the "Form contains sequence" condition is also the place where you should use square brackets, provided that you follow the syntax, which is also available in the manual.
Pages:
Actions