[DUG] Make all possible unique combinations

Rodney Chan rchan at compuspec.com
Thu Dec 10 12:28:52 NZDT 2009


Is it OK to use

for low(ArrayName) to high(ArrayName) do
...

Rodney



-----Original Message-----
From: delphi-bounces at delphi.org.nz
[mailto:delphi-bounces at delphi.org.nz]On Behalf Of
delphi-request at delphi.org.nz
Sent: Thursday, 10 December 2009 12:12 p.m.
To: delphi at delphi.org.nz
Subject: Delphi Digest, Vol 74, Issue 6


Send Delphi mailing list submissions to
	delphi at delphi.org.nz

To subscribe or unsubscribe via the World Wide Web, visit
	http://listserver.123.net.nz/mailman/listinfo/delphi
or, via email, send a message with subject or body 'help' to
	delphi-request at delphi.org.nz

You can reach the person managing the list at
	delphi-owner at delphi.org.nz

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Delphi digest..."


Today's Topics:

   1. Make all possible unique combinations (Sandeep Chandra)


----------------------------------------------------------------------

Message: 1
Date: Wed, 9 Dec 2009 14:47:10 -0800 (PST)
From: Sandeep Chandra <sandeep_groups at yahoo.com>
Subject: [DUG] Make all possible unique combinations
To: delphi at delphi.org.nz
Message-ID: <729593.59672.qm at web30901.mail.mud.yahoo.com>
Content-Type: text/plain; charset=utf-8

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






------------------------------

_______________________________________________
Delphi mailing list
Delphi at delphi.org.nz
http://listserver.123.net.nz/mailman/listinfo/delphi

End of Delphi Digest, Vol 74, Issue 6
*************************************



More information about the Delphi mailing list