Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Partial Searching
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01107859
Message ID:
01107876
Views:
21
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform