I have a List of Maps (the result of parsing a JSON String).
The Maps represent the two elements of the Primary Key of a SQLITE table eg:-
List = (PKMap1, PKMap2, PKMap3, PKMap4)
Where
PKMap1: (ID=1, DeviceNo=6789)
PKMap2: (ID=2, DeviceNo=6789)
PKMap3: (ID=1, DeviceNo=7123)
PKMap4: (ID=2,DeviceNo=7123)
I want to check if another record exists in the List, say
PKMap5: (ID=3, DeviceNo=6789)
Q1) Can I use:-
if List.IndexOf(PKMap5) = -1 then
'UpLoad PKMap5
Q2) If so, will the Map have to be in the same order?
ie will (ID=3, DeviceNo=6789) Match (DeviceNo=6789, ID=3)
Q3) If this stands a chance of working then I guess I will have to be careful how the various bits are Dim'ed to make sure that I am comparing Maps, and not pointers to Maps?
The Maps represent the two elements of the Primary Key of a SQLITE table eg:-
List = (PKMap1, PKMap2, PKMap3, PKMap4)
Where
PKMap1: (ID=1, DeviceNo=6789)
PKMap2: (ID=2, DeviceNo=6789)
PKMap3: (ID=1, DeviceNo=7123)
PKMap4: (ID=2,DeviceNo=7123)
I want to check if another record exists in the List, say
PKMap5: (ID=3, DeviceNo=6789)
Q1) Can I use:-
if List.IndexOf(PKMap5) = -1 then
'UpLoad PKMap5
Q2) If so, will the Map have to be in the same order?
ie will (ID=3, DeviceNo=6789) Match (DeviceNo=6789, ID=3)
Q3) If this stands a chance of working then I guess I will have to be careful how the various bits are Dim'ed to make sure that I am comparing Maps, and not pointers to Maps?