Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To handle a character string
Message
 
 
To
22/04/2006 13:03:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01115703
Message ID:
01115709
Views:
6
Hilmar,

I thought this code but one can have problems if

"Rue des 7 bonniers 24" =======> "rue des 7 bonniers"
Do cMakestreet("Rue des 7 bonniers 24" )


PROCEDURE cMakestreet
  PARAMETERS cVarToTried


  LOCAL nlen ,;
    cvariable,;
    x

  cVarToTried = STRTRAN(  cVarToTried  , '/' , ''  )
  cVarToTried = STRTRAN(  cVarToTried  , 'no' , ' '  )
  cVarToTried = STRTRAN(  cVarToTried  , '\' , '' )
  cVarToTried = STRTRAN(  cVarToTried  , 'n°' , ' ' )
  cVarToTried = STRTRAN(  cVarToTried  , '?' , '' )
  cVarToTried = STRTRAN(  cVarToTried  , 'boîte' , '' )
  cVarToTried = STRTRAN(  cVarToTried  , 'bte' , '' )
  cVarToTried = STRTRAN(  cVarToTried  , '( )' , ' ' )
  cVarToTried = STRTRAN(  cVarToTried  , '()' , ' ' )


  nlen = LEN(cVarToTried)
  cvariable = ""

  FOR x = 1 TO nlen
    IF ( ISDIGIT( SUBSTR( cVarToTried , x , 1 ) ) = .F. OR;
        SUBSTR( cVarToTried,x,1 ) = " " ) AND ;
        SUBSTR( cVarToTried,x,1 ) <> ","

      cvariable = cvariable + SUBSTR( cVarToTried , x , 1 )
    ENDIF
  ENDFOR

  RETURN ALLTR( cvariable )
ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform