Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search of several units in the array.
Message
De
07/11/1998 07:42:56
 
 
À
07/11/1998 06:07:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00155468
Message ID:
00155473
Vues:
24
>Hi.
>There is an array aCache [x, 4]
>It is necessary to me to find the fourth array cell on 3 known values.
>If it would be in the table I has written
>LOCATE FOR x1=Search1 AND x2=Search2 AND x3=Search3
>IF FOUND ()
> lnResult = x4
>ENDIF
>But as it to make with array cells?

The best I can come up with off the top of my head:
LOCAL nRow, nNumRows
nNumRows = ALEN(aCache,1)
FOR nRow = 1 TO nNumRows
   IF (aCache[nRow,1] = Search1) AND ;
      (aCache[nRow,2] = Search2) AND ;
      (aCache[nRow,3] = Search3)
        EXIT
   ENDIF
ENDFOR
IF nRow > nNumRows
   *  Not found
ELSE
   *  nRow is the row we found that met the criteria
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform