Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To handle a character string
Message
De
22/04/2006 13:19:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01115703
Message ID:
01115711
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all,
>
>I must reimport an address file.
>
>"Rue de l'université 7 " =====> "Rue de l'université"
>"place victor hugo 7Bte 15" ====> "place victor hugo"
>"rue des mineurs 14b" =====> "rue des mineurs"
>etc...
>
>A small assistance for this action ?
>
>thank in advance for help
>
>bernhart

Today's exercise in "help-a-fellow-programmer"
?roadname("Rue de l'université 7") && Rue de l'université

Function justroadname
Lparameters pcRoad
If Pcount()<1 Or Vartype(pcRoad)#'C'
  Return ''
Endif 
Local lnWord, lcReturn, lnWordcount
lnWordcount=Getwordcount(pcRoad)
lcReturn=''
For x=1 To lnWordCount
  If Val(Getwordnum(pcRoad,x))=0
    lcReturn=lcReturn + Getwordnum(pcRoad,x) + ' '
  Else 
    Exit 
  Endif 
Endfor 
Return Trim(lcReturn)
I see that Viv had the same idea..! Another soulution is to remowe the last word if val(lastword)>0. Not 100% safe, but will remove most of the ambigous house numbers.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform