Pages:
Actions
  • #1 by mikejcshaw on 21 Jun 2017
  • I need to keep a variable with the names of horses that I bet on. I was using 'set variable' set to storednames+sel_name every time a new horse is added. I am then using FIND("sel_name", "storednames") to see if a bet has been made, (if result is >0). However I am encountering a problem with spaces being removed from the horses name when adding it to the variable but not when using sel_name in the FIND expression and thus the name is not found. Can you offer any suggestions? Thanks
  • #2 by MarkV on 21 Jun 2017
  • Hi
    string variables should be in quotation marks, use "sel_name" when adding to your user variable. 
  • #3 by mikejcshaw on 22 Jun 2017
  • Sadly that doesn't solve the problem. I have set up a test as follows:

    Trigger A
    - set user variable  myvar  myvar+"sel_name"
    - set user variable myvarset  1

    Trigger B
    Conditions myvarset is equal to 1
    - set user variable  myvarposition  FIND("sel_name", "myvar")

    Both selections set to Favourite

    Results using View User Variables
    myvar=myvar+"Simpson"+"Simpson"  (Not sure why the name is added twice)
    myvarset=1
    myvarposition=FIND("Simpson","myvar+"Simpson"+"Simpson"")  (i.e. doesn't compute)
  • #4 by Oxa (WellDoneSoft) on 22 Jun 2017
  • Hello!

    The program is not made to allow the concatenation of strings in that way. Are you tring to add another string to the selection's name?
  • #5 by mikejcshaw on 22 Jun 2017
  • I'm trying to keep a list of horses that a particular trigger has placed a bet on. Other triggers can also place bets on the same horse. I am doing this by adding the horses name to a string when a bet is placed on it. It was working but only if there were no spaces in the horses name. Maybe you can suggest a better way of achieving this.

    Thanks
  • #6 by Oxa (WellDoneSoft) on 22 Jun 2017
  • There is a much simple way of doing this. Check this condition where you need to find out whether a particular trigger has been executed on the selection:

    Trigger [trigger name] Number of executions per selection is greater than 0
  • #7 by mikejcshaw on 22 Jun 2017
  • Thanks Oxa - I'll give it a go
Pages:
Actions