Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Partial Searching
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01107859
Message ID:
01107876
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>Thankyou Tore,
>
>I am trying to learn FOR Statements and I thought I would try using one to extract say a list of suppliers from a partial string search.
>
>
>PUBLIC cNewSupplier
>cSupplier = 'Ozbecek Lamin Flowline'
>
>STORE GETWORDCOUNT(cSupplier,' ') TO lcsupcount
>
>cNewSupplier = ''
>FOR x=1 TO lcsupcount
>	IF EMPTY(cNewSupplier)
>	  STORE 'descrip1 =' GETWORDNUM(cSupplier,(x),' ') TO lcNewSupplier
>	  ELSE
>	  STORE cNewSupplier + ' or descrip1 = ' + GETWORDNUM(cSupplier,(x),' ') TO cNewSupplier
>	ENDIF
>NEXT
>
>
>Basically I would the result of cNewSupplier to be:
>
>descrip1 = Ozcecek or descrip1 = Lamin or descrip1 = Flowline
>
>Could you help me please?
PUBLIC cNewSupplier
cSupplier = 'Ozbecek Lamin Flowline'

STORE GETWORDCOUNT(cSupplier,' ') TO lcsupcount

cNewSupplier = ''
FOR x=1 TO lcsupcount
    IF EMPTY(cNewSupplier)
       STORE [descrip1 ='] + GETWORDNUM(cSupplier,(x),' ') + ['] TO lcNewSupplier
    ELSE
       STORE cNewSupplier + [ or descrip1 = '] + GETWORDNUM(cSupplier,(x),' ') + ['] TO cNewSupplier
    ENDIF
NEXT
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform