ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Need Help with Arrays

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Help with Arrays

    Hi

    I have a Departments Array DETARR like this
    DEPTARR(1) =213
    DEPTARR(1) =214
    DEPTARR(1) =213
    DEPTARR(1) =215
    DEPTARR(1) =217
    DEPTARR(1) =215
    DEPTARR(1) =213
    DEPTARR(1) =217
    DEPTARR(1) =218
    DEPTARR(1) =218

    and I want to have a unique DEPTARR array which should not contain the duplicates.

    Help is much appreciated. Thanks!!

  • #2
    Re: Need Help with Arrays

    Hi,

    Better read the elements one by one and move to another array. Before moving using %Lookup, check whether the data is available or not. If its not there then move it.
    Regards,
    Vinothkumar S.

    Comment


    • #3
      Re: Need Help with Arrays

      Hi,

      I have already done that and was looking for a better way to accompalish this task. Anyways Thanks alot for replying and strethening my thought that this probably is one of the best ways to resolve this.

      Comment


      • #4
        Re: Need Help with Arrays

        You could first SORTA DETARR then check the current entry against the previous one, that should run faster.
        Philippe

        Comment

        Working...
        X