playMaker

Author Topic: Array Add Difference/Shared  (Read 1144 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • My Video Game Projects Web Site
Array Add Difference/Shared
« on: September 26, 2019, 09:13:10 PM »
I want to compare two arrays A and B. Any entries contained in both, will be added to a third array C "Shared". Any entries that only one array B contains, will be added to a fourth array D "New Entries".

Perhaps these should be two separate actions instead of one.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15494
  • Official Playmaker Support
    • View Profile
Re: Array Add Difference/Shared
« Reply #1 on: October 17, 2019, 05:29:11 AM »
hi,

 you are better off doing that in a loop.

reset C and D
loop through A: for each item in A contained in B, add to C
loop through B: for each item in B not contained in A, add to D

that's it.

 Bye,

 Jean