Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seek - not exact search? What does influence on it?
Message
 
 
À
04/01/2000 14:42:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00312453
Message ID:
00312707
Vues:
15
Hi Mike & Jim,

>>The safest way to enforce exact matching is;
>>? SEEK(PADR("111",LEN(hhh),"0"), "hhh","code")
>
>"hhh" is the table name (second paremeter), the third parameter is that index tag, you would have to get the expression from the tag (I think its KEY(TAGNO(tag))), and base your LEN() on that.

In my validate() method I place this code:
lparameter lcValue && character value to check
local lcOldExact
lcOldExact=set('exact') && Save current settings
set exact on && To perform exact match
if !empty(this.CursorName) and !empty(lcValue) and type('lcValue')='C' && Character field
   if seek(lcValue,this.CursorName, 'Code') && Check if it's duplicate
   		=messagebox('There is a duplicate! '+lcValue+ ' will not be added!',48,'Warning')
   		return .f.
   endif
endif   
set exact &lcOldExact && Restore old settings
return .t.
There lcValue is already alltrimed.
Why do you think it's not good enough?

At least, as I ckecked it, it worked...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform