Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To handle a character string
Message
 
À
22/04/2006 13:03:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01115703
Message ID:
01115709
Vues:
7
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform