Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding quotes to a string
Message
 
To
01/11/2006 14:34:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01165777
Message ID:
01166319
Views:
15
>Pretty near Borislav, the only fact is that it always create a new ...INLIST(this.cfield).... wich performs several inlist on same field giving as result that filter doesn't work, to be sure that it works the inlist(xfield must be at the same part always.
>
>lcFilter = FILTER([YourAliasHere])
>TEXT TO lcFilt NOSHOW PRETEXT 15 TEXTMERGE
>     <<lcFilter>> <<IIF(EMPTY(lcFilter),[],[ AND ])>>
>     INLIST(<<this.lcfield>>,'<<lcValue>>')
>ENDTEXT
>
O, Then:
lcFilter = FILTER([YourAlias])
IF ATC([INLIST(]+this.lcfield, lcFilter) > 0
   lcFilter = STRTRAN(lcFilter, STREXTRACT(lcFilter,[INLIST(]+this.lcfield,[)],1,1+4),[])
ENDIF
TEXT TO lcFilt NOSHOW PRETEXT 15 TEXTMERGE
     <<lcFilter>> <<IIF(EMPTY(lcFilter),[],[ AND ])>>
     INLIST(<<this.lcfield>>,'<<lcValue>>')
ENDTEXT
SET FILTER TO &lcFilt IN YourAlias
GO TOP IN YourAlias
not tested well
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