Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compare if the content of two arrays are equals
Message
De
17/07/2003 11:34:48
 
 
À
17/07/2003 10:20:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00811071
Message ID:
00811103
Vues:
16
>Is there a function or command to do this? Without using a loop.

Antonio,

I have not tested it but I feel it may work (of course, no objects)
?ArrayEqual(@ArrayName1, @ArrayName2)

function ArrayEqual(Array1, Array2)
   
   local s, AreEqual
   s = select(0)

   create cursor XXX (A1 M default '' nocptrans, A2 M default '' NOCPTRANS)
   append blank
   =SaveToMemo(@array1, 'a1')
   =SaveToMemo(@array2, 'a2')
   AreEqual = (a1 == a2)
   use in xxx
   select (s)
   return AreEqual
endfunc

function SaveToMemo(ArrayName, FieldName)
  save to memo (FieldName) all like ArrayName
endfunc
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform