Author Topic: When to use different types of brackets?  (Read 8121 times)

Tags:
  • All members
  • Posts: 405
When to use different types of brackets?
« on: 30 Oct 2017, 15:21 »
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

  • Guest
Re: When to use different types of brackets?
« Reply #1 on: 30 Oct 2017, 15:56 »
are you putting a square bracket in a round hole ???

:) :)

Larp

  • All members
  • Posts: 405
Re: When to use different types of brackets?
« Reply #2 on: 30 Oct 2017, 16:44 »
Hi Larp

If feels like that sometimes!

I was just wondering if there's some rule when to use different ones, that's all :)

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: When to use different types of brackets?
« Reply #3 on: 31 Oct 2017, 16:19 »
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.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 405
Re: When to use different types of brackets?
« Reply #4 on: 31 Oct 2017, 21:32 »
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?



  • All members
  • Posts: 405
Re: When to use different types of brackets?
« Reply #5 on: 01 Nov 2017, 10:20 »
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


  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: When to use different types of brackets?
« Reply #6 on: 01 Nov 2017, 14:10 »
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.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

 

Please note, BetFair is seems to be currently OFFLINE