[DUG] Make all possible unique combinations

Sandeep Chandra sandeep_groups at yahoo.com
Thu Dec 10 11:47:10 NZDT 2009


I am looking for ideas to generate all possible combinations for the following arrays. I don't want to use for.. loops as number of arrays can change.

const
  STGR : array[1..2] of string = ('A1', 'A2');
  STG1 : array[1..4] of string = ('B1', 'B2', 'B3', 'B4');
  STG2 : array[1..2] of string = ('C1', 'C2');
  .
  .
  STGN : array[1..2] of string = ('N1', 'N2');


I have an algorithm to this but was wondering if there are other simpler/better/quicker ways to do this.

Regards

Sandeep


      



More information about the Delphi mailing list