Skip to Content
avatar image
Former Member

How to compare several strings

Hi,

I want to compare the first character of a batch number in the expression editor of an action block and check if it is an alpha character.how to compare with all the 26 alpha characters.Is there any way to compare as we have in SQL as [A-Z].

e.g: if my batch number is F012345 or S012345,i want to exclude these. and if my batch number is 7012345 or 5012345,I want to include this.

Thanks in advance,

Sanjeev

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    May 23, 2011 at 07:24 AM

    Hi sanjeev,

    I can suggest following solution:

    take one local variable suppose x=F012345

    than use stringleft and number function to verify first character is string or number.

    Take first character of your batch number using string function.

    stringleft(X,1)=F

    Check wheather it is number or not by number function

    number(stringleft(X,1))=0

    but before number function you have to check stringleft(X,1) != 0

    Than I think your logic will work.

    Regards,

    Manoj Bilthare

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Manoj,

      It was not possible for me to give those conditions before switch as you suggested,however,I gave it a thought and was able to replace the switch block having 12 inputs,with 3 conditional blocks and then implemented your previous logic.

      It is working perfectly now.

      Thanks

      Sanjeev