capital L

Lerebours, Jose Jose.Lerebours at EagleGL.com
Wed Feb 15 05:19:10 PST 2006


Jeff wrote:
> 
> > Using windows and filepro 5.0
> > 
> > How do I identify the occurrence of a capital L
> > 
> > ie = instr(ua, "L","1")   identifies any l not just
> > capital L
> > 
> > Thanks in advance>
> 
> Check out the COMPARE command.
> 

To use the compare() function, you will need to use
a loop to check each character within the string.

Here is a simple routine that will do just that:

---------------------------------------------------------
  1  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If:                                             
       Then: xa=""{ua{""; xb(2,.0)=len(xa); xc(2,.0)="1" 
  2  -------   -   -   -   -   -   -   -   -   -   -   - 
LOOP   ! If: xc gt xb                                    
       Then: goto ENDLOOP                                
  3  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If: mid(xa,xc,"1") ne "L"      'Is it an L ???                 
       Then: xc=xc+"1"; goto LOOP                        
  4  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If:                                             
       Then: xd(5,.0)=compare(mid(xa,xc,"1"),"L")        
  5  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If: xd ne "0"                  'Is it upper L ?                 
       Then: xc=xc+"1"; goto LOOP                        
  6  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If:                                             
       Then: ***** DO WHAT YOU WANT HERE *****           
  7  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If:                                             
       Then: xc=xc+"1"; goto LOOP                        
  8  -------   -   -   -   -   -   -   -   -   -   -   - 
ENDLOOP! If:                                             
       Then:                                             
  9  -------   -   -   -   -   -   -   -   -   -   -   - 
       ! If:                                             
       Then: end                                         
 10  -------   -   -   -   -   -   -   -   -   -   -   - 


Hope this points you in the right direction.


Jose Lerebours


NOTE:  I did not test this code and cannot guarantee
       that it will do exactly what you are looking for
       nor suggest that it is functional.  Please do due
       diligence prior to incorporating into your 
       production application.


More information about the Filepro-list mailing list