Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search in all fields.
Message
From
07/04/2000 07:49:49
 
 
To
07/04/2000 07:43:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00356719
Message ID:
00356736
Views:
12
>Hi Cemal.
>
>>> Do you know a way to this programaticly <<
>
>
>LPARAMETERS tcAlias, tuSearchVal, tlMatchWholeField
>LOCAL laFields[1], lnFieldCnt, lnField, llMatchFound, luCompVal
>*** Make sure passed alias is available
>IF ! USED( tcAlias )
>  USE ( tcAlias ) IN 0
>ENDIF
>*** Get the field names
>lnFieldCnt = AFIELDS( laFields, tcAlias )
>SELECT ( tcAlias )
>*** Scan the table
>SCAN
>  *** look for a match in each field
>  FOR lnField = 1 TO lnFieldCnt
>    luCompVal = IIF( INLIST( VARTYPE( EVAL( lafields[ lnField, 1 ] ) ), 'C', 'M' ), ALLTRIM( EVAL ( laFields[ lnField, 1 ]  ) ), EVAL ( laFields[ lnField, 1 ] ) )
>    llMatchFound = .F.
>    IF tlMatchWholeField
>      IF tuSearchVal == luCompVal
>        llMatchFound = .T.
>	EXIT
>      ENDIF
>    ELSE
>      IF INLIST( VARTYPE( EVAL( lafields[ lnField, 1 ] ) ), 'C', 'M' )
>        IF tuSearchVal $ luCompVal
>	  llMatchFound = .T.
>	  EXIT
>	ENDIF
>      ENDIF
>    ENDIF
>  ENDFOR			
>  IF llMatchFound
>    EXIT
>  ENDIF
>ENDSCAN
>IF llMatchFound
>  MESSAGEBOX( 'Match found in field: '+laFields[ lnField, 1 ]+CHR(13)+ 'Record Number '+ALLTRIM( STR( RECNO( tcAlias) ) ) )
>ENDIF	
>
>
>Marcia

Thanks Marcia.
Im trying it yet.
Previous
Reply
Map
View

Click here to load this message in the networking platform