× Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...

how to remove duplicates in array

More
1 year 11 months ago #24186 by soni
how to remove duplicates in array was created by soni
I need to write infobasic code which will remove duplicates from the given array and keep unique value. can any1 pls help me with this I am new to infobasic.

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
1 year 11 months ago - 1 year 11 months ago #24189 by VK
Replied by VK on topic how to remove duplicates in array
Hi
if we're talking about dynamic arrays:

Create an empty new array;
in a LOOP ... REPEAT:
- use REMOVE to get next element of given array;
- use FIND to see if it's found in new array;
- if it is not found: add it to the new array.
 

Cheers
VK
Last edit: 1 year 11 months ago by VK.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24191 by soni
Replied by soni on topic how to remove duplicates in array
Hi,
Thank you so much
It worked.

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds