Anyone know how to... ?
I have to filter all records where a field (eg. description in Item) contains the following value: (E)
The parenthesis "(" is part of the value but after trying diffent way I didn't get out of it.
The code would look like this:
gRecItem.RESET ;
gRecItem.SETFILTER(gRecItem.Description,'*(E)*') ;
IF gRecItem.FINDFIRST THEN
REPEAT ;
gRecItem.Extra := 'E' ;
gRecItem.MODIFY ;
UNTIL gRecItem.NEXT = 0 ;
MESSAGE('Done') ;
Comments
then * ?E? *
http://www.BiloBeauty.com
http://www.autismspeaks.org
have you tried: gRecItem.SETFILTER(gRecItem.Description,'*%1*','(E)') ;
or: gRecItem.SETFILTER(gRecItem.Description,%1,'*(E)*') ;?
you could also try this:
gRecItem.RESET ;
IF gRecItem.FINDSET(TRUE,FALSE) THEN REPEAT
IF STRPOS(gRecItem.Description,'(E)') <> 0 THEN BEGIN
gRecItem.Extra := 'E' ;
gRecItem.MODIFY ;
END:
UNTIL gRecItem.NEXT = 0 ;
MESSAGE('Done') ;
The @ you can leave if you need a upper E. If you search for e/E set the @.
If you see, the code filter also Descriptions where a space is between the letters. If there is a other letter (not space) between this characters, you can also use harry's solution (@*(?E?)*).
Regards