compare two arrays

compare two arrays

Postby Natter » Wed Jun 19, 2024 7:12 pm

Is there any function to compare the identity of two arrays (so as not to do it piecemeal ) ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: compare two arrays

Postby Cgallegoa » Wed Jun 19, 2024 11:52 pm

Code: Select all  Expand view
#include "FiveWin.ch"

Function Main()

   local a1 := { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 },;
                 { 1, 1, 0 }, { 1, 0, 1 }, { 0, 1, 1 }, { 1, 1, 1 } }
   local a2 := { { 0, 0, 0 }, { 1, 1, 1 } }
   local a3 := { { 0, 0, 0 }, { 1, 1, 1 } }
   
   MsgInfo( "*** Syntax 1: ***" + CRLF + CRLF + ;
            "a1 == a2:  " + cStr(fw_ValToExp( a1 ) == fw_ValToExp( a2 )) + CRLF + ;
            "a2 == a3:  " + cStr(fw_ValToExp( a2 ) == fw_ValToExp( a3 )))

   MsgInfo( "*** Syntax 2: ***" + CRLF + CRLF + ;
            "a1 == a2:  " + cStr(FW_StrICmp( a1, "==", a2 )) + CRLF + ;
            "a1 == a3:  " + cStr(FW_StrICmp( a1, "==", a3 )) + CRLF + ;
            "a2 == a3:  " + cStr(FW_StrICmp( a2, "==", a3 )))

Return nil
 

Regards,
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: compare two arrays

Postby Natter » Thu Jun 20, 2024 7:04 am

Thanks, I get it!
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 35 guests

cron