FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour compare two arrays
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
compare two arrays
Posted: Wed Jun 19, 2024 07:12 PM

Is there any function to compare the identity of two arrays (so as not to do it piecemeal ) ?

Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: compare two arrays
Posted: Wed Jun 19, 2024 11:52 PM
Code (fw): Select all Collapse
#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-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: compare two arrays
Posted: Thu Jun 20, 2024 07:04 AM

Thanks, I get it!

Continue the discussion