Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does this code erase all locations?
Message
De
06/12/2006 18:02:50
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
06/12/2006 17:42:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01175423
Message ID:
01175438
Vues:
9
Hey Grady

What index do you have on crimetype? I'm hoping it's upper(crimetype).

Then you can use...

SCAN FOR NOT INLIST(UPPER(CRIMETYPE),;
"B&E CABIN ",;
"B&E HOME ",;
"B&E BUSINESS"

Notice I'm padding the B&E strings. Make them the same length as your field.
Inlist is Rushmore optimizable.

>>You FOR condition is always true. Change OR to AND or better to INLIST().
>>Scan For NOT INLIST(Alltrim(crimetype), "B&E Cabin", "B&E Home", "B&E Business", "B&E Garage")
>>
>>>Why does this code erase all the locations when it should only remove those not in the scan line of code?
>>>
>>>Scan For Alltrim(crimetype) <> "B&E Cabin" ;
>>  OR  Alltrim(crimetype) <> "B&E Home" ;
>>  OR Alltrim(crimetype) <> "B&E Business"
>>  OR  Alltrim(crimetype) <> "B&E Garage"
>>>	ShapeID = localcrime1.shapename
>>>	Thisform.RemoveObject(ShapeID)
>>>Endscan
>>>
>
>That got it Sergey. Thanks. I'm going to use that INLIST command more often.
>
>Grady
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform