Announcement

Collapse
No announcement yet.

Symbol contains

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Symbol contains

    This is the line I have in my EFS that is working fine at the moment as long as I use ES #F

    if(vSym == "ES #F") {if(sEssion == "24h") s=1; if(sEssion == "Day") s=37};

    What I would like to do is probably simple but I can't figure it out

    I would like the EFS to find any permutation of ES xx so I dont have to use the #F and dont have to change the EFS on every contract change.

    Can anyone help Please

  • #2
    Re: Symbol contains

    richbois
    Assuming vSym is a string you could do it in the following way
    PHP Code:
    if(vSym.charAt(0)=="E" && vSym.charAt(1)=="S" && vSym.charAt(2)==" "){ 
    using the charAt() method of the String Object
    Alex


    Originally posted by richbois
    This is the line I have in my EFS that is working fine at the moment as long as I use ES #F

    if(vSym == "ES #F") {if(sEssion == "24h") s=1; if(sEssion == "Day") s=37};

    What I would like to do is probably simple but I can't figure it out

    I would like the EFS to find any permutation of ES xx so I dont have to use the #F and dont have to change the EFS on every contract change.

    Can anyone help Please

    Comment


    • #3
      Thank you that worked

      Comment


      • #4
        richbois
        You are most welcome
        Alex


        Originally posted by richbois
        Thank you that worked

        Comment

        Working...
        X