Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To handle a character string
Message
 
 
To
22/04/2006 13:19:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01115703
Message ID:
01115742
Views:
7
WAIT WIND justroadname("Rue des 7 bonniers 34") && 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=pcRoad
  

  FOR x=lnWordcount TO 1 STEP -1
    IF VAL(GETWORDNUM(pcRoad,x))>0
      
           lcReturn=  STRTRAN( pcRoad  , GETWORDNUM(pcRoad,x) , '' )
      

      EXIT
    ELSE

      *    Exit
    ENDIF
  ENDFOR
  RETURN TRIM(lcReturn )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform