Author Topic: "silk_wearing" query - how to determine if an empty string?  (Read 3619 times)

Tags:
  • All members
  • Posts: 154
  • Gender: Male
Hi,

just done a search for silk_wearing and there was one hit from 12/10/10 about the syntax.  However, it doesn't answer the question below.

I want to determine whether a horse is wearing any head gear.  The options for processing silk_wearing are a long way short of silk_form.  What is a quick way of determining whether silk_wearing is blank or not?

There isn't a silk_wearing_length variable option.  Also, when I looked at r_1_silk_wearing & r_2_silk_wearing for the 14:00 at Perth today I got the same result even though in Engineer Mode I can clearly see they are different (screen shot attached) so I think there might be a bug??

Because headgear can be worn in combinations, I really hope the answer isn't "silk_wearing is in list ...." because to cover all options it will be a long list!

regards

Wez


  • Moderator
  • Posts: 3631
*
Hi
I've taken some selections from the same race you mentioned and put them in the variable viewer, see attached.
Using the FIND function for string data, and looking for a blank space " " you can see a blank space occurs at position 1 in an empty variable.
So the condition to determine an empty silk_wearing value:
and selections trigger expression FIND(" ", "silk_wearing") is equal to 1 
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 154
  • Gender: Male
Thanks Mark.

I've noticed you use double quotes whereas I didn't and I'm guessing I should start using the same when referring to strings!  I also hadn't realised the FIND function has to be written in uppercase either!

many thanks, much appreciated.

regards

Wez

  • All members
  • Posts: 406
Hi

I realise that this is an old thread, but I wonder if the syntax has changed in a more recent release of mfp as I cant get Marks formula to work.

As you can see from the attached screen grab, selection 1 (Tintown Robin) has no extra equipment listed.  Yet using the formula FIND(" ", "silk_wearing")  doesn't bring up the result 1 as it did for Mark.  

I also have put in the formula  FIND("", "silk_wearing") (same but with no space between the quotation marks)

any clues as to what I'm doing wrong? I too want to identify horses not wearing any extra equipment.

Thanks

  • Moderator
  • Posts: 3631
*
Hi armarni
probably better to use a condition "is not in list":
and selections trigger expression "silk_wearing" is not in list "hood", "visor", "tongue strap", "blinkers" ...etc.
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 406
Hi Mark

That is indeed what I have been doing, but I've noticed that often a horse can have a combination of extra equipment, which is listed "cheekpieces and hood" etc.  To create an 'is not in list' that covers all combinations of extra equipment in various orders would be extremely long.

I was hoping that the elegant solution you suggested last year would work.  It seems crazy that you can't determine if a string is empty or not.

  • Moderator
  • Posts: 3631
*
try this:

AND NOT  <--- condition block
     selections trigger expression FIND(" ","silk_wearing") is equal or greater than 0
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 406
Thanks for the help Mark, I'll try that tomorrow and report back.

quick question, what do you mean by <-------condition block?

I was simply going to write:

AND NOT selections trigger expression FIND(" ","silk_wearing") is equal or greater than 0

is that not correct? 

  • Moderator
  • Posts: 3631
*
when I tested it, it was the only condition and you have to start the first condition with selections or markets etc.
if it's the second or following condition, you can have and not / or etc.

so I had to put it in a condition block starting
AND NOT
            selections trigger expression ...
  

hope that makes sense
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 406
Just to let you know Mark, that your last suggestion did the trick and correctly found the horse with no extra equipment.

Thanks for your help.

 

Please note, BetFair is seems to be currently OFFLINE