instr

GCC Consulting gccconsulting at comcast.net
Thu Feb 16 06:45:22 PST 2006


I have been watching this thread and decided to play with the problem.

These is a solution, not elegant but workable.

  8  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: declare one,two
  9  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: a="123abcfqrltyu"
 10  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:'removed after testing line 11 format
       Then: 'aa=instr(a,"l")
 11  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: b=mid(a,instr(a,"1","1"))
 12  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: one=asc(b);two=asc("L")
 13  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: MSGBOX "The first character is \b5"<one<"\a-\nthe Second Character is \r"<two"<"\r"
 14  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: x=compare(one,two)
 15  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If: x = "-1"
       Then: MSGBOX "This is a Capital L";END
 16  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If: x = "1"
       Then: MSGBOX "This is a Lower Case L";END
 17  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If: x = "0"
       Then: MSGBOX "They are both the same";END
 18  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

Of course this assumes that one always wants to test for the upper case L.  You can reverse the test and it still works.  

I will grant that this may not be what everyone wants but it will accomplish the desired result in a few steps.

Richard Kreiss 
GCC Consulting




More information about the Filepro-list mailing list