[DUG] Make all possible unique combinations

Rodney Chan rchan at compuspec.com
Thu Dec 10 13:54:41 NZDT 2009


Hi Sandeep,

Is is possible to use 2 dimensional dynamic array ...
http://stackoverflow.com/questions/162753/using-length-with-multi-dimensiona
l-dynamic-arrays-in-delphi

You can have non-rectangular 2 dimensional dynamic array.

However, I don't think you can have non-rectangular 2 dimension array
constant so you may need to change the declaration to variable:

var 2DStrArr: array of array of string;


Cheers
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:43 p.m.
To: delphi at delphi.org.nz
Subject: Delphi Digest, Vol 74, Issue 7


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. Re: Make all possible unique combinations (Cameron Hart)
   2. Re: Make all possible unique combinations (Sandeep Chandra)
   3.  Make all possible unique combinations (Rodney Chan)
   4. Re: Make all possible unique combinations (Cameron Hart)
   5. Re: Make all possible unique combinations (Sandeep Chandra)
   6. Re: Make all possible unique combinations (ROHIT GUPTA)


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

Message: 1
Date: Thu, 10 Dec 2009 12:20:02 +1300
From: "Cameron Hart" <Cameron.Hart at flowsoftware.co.nz>
Subject: Re: [DUG] Make all possible unique combinations
To: "NZ Borland Developers Group - Delphi List" <delphi at delphi.org.nz>
Message-ID:
	<DBC5CCA98A0EE4459C8BE38BF3028F123BE6C6 at flowserver.flow.net.nz>
Content-Type: text/plain;	charset="US-ASCII"

Hi Sandra

Perhaps if you share your existing algorithm we can help you faster.

Cameron Hart | Development Manager | Flow Software Limited
P: +64 9 476 3579 | M: +64 21 222 3569 | E:
cameron.hart at flowsoftware.co.nz
PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
www.flowsoftware.co.nz

This message is intended for the addressee named above. It may contain
privileged or confidential information. If you are not the intended
recipient of this message you must not use, copy, distribute or disclose
it to anyone.

Please consider the environment before printing this email

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Sandeep Chandra
Sent: Thursday, 10 December 2009 11:47 a.m.
To: delphi at delphi.org.nz
Subject: [DUG] Make all possible unique combinations

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




_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe



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

Message: 2
Date: Wed, 9 Dec 2009 15:28:04 -0800 (PST)
From: Sandeep Chandra <sandeep_groups at yahoo.com>
Subject: Re: [DUG] Make all possible unique combinations
To: NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
Message-ID: <526609.33112.qm at web30905.mail.mud.yahoo.com>
Content-Type: text/plain; charset=utf-8

I don't remember changing my name to Sandra from Sandeep!



----- Original Message ----
From: Cameron Hart <Cameron.Hart at flowsoftware.co.nz>
To: NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
Sent: Thu, 10 December, 2009 12:20:02 PM
Subject: Re: [DUG] Make all possible unique combinations

Hi Sandra

Perhaps if you share your existing algorithm we can help you faster.

Cameron Hart | Development Manager | Flow Software Limited
P: +64 9 476 3579 | M: +64 21 222 3569 | E:
cameron.hart at flowsoftware.co.nz
PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
www.flowsoftware.co.nz

This message is intended for the addressee named above. It may contain
privileged or confidential information. If you are not the intended
recipient of this message you must not use, copy, distribute or disclose
it to anyone.

Please consider the environment before printing this email

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Sandeep Chandra
Sent: Thursday, 10 December 2009 11:47 a.m.
To: delphi at delphi.org.nz
Subject: [DUG] Make all possible unique combinations

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




_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe







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

Message: 3
Date: Thu, 10 Dec 2009 12:28:52 +1300
From: Rodney Chan <rchan at compuspec.com>
Subject: [DUG]  Make all possible unique combinations
To: delphi at delphi.org.nz
Message-ID: <000801ca7927$5ed47db0$ed00000a at DCSPEC12>
Content-Type: text/plain; charset=us-ascii

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
*************************************



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

Message: 4
Date: Thu, 10 Dec 2009 12:36:36 +1300
From: "Cameron Hart" <Cameron.Hart at flowsoftware.co.nz>
Subject: Re: [DUG] Make all possible unique combinations
To: "NZ Borland Developers Group - Delphi List" <delphi at delphi.org.nz>
Message-ID:
	<DBC5CCA98A0EE4459C8BE38BF3028F123BE6C8 at flowserver.flow.net.nz>
Content-Type: text/plain;	charset="US-ASCII"

I was just optimizing your name S[andeep Ch]andra.  I can do the same
with your algorithm when you send it through.

Cameron Hart | Development Manager | Flow Software Limited
P: +64 9 476 3579 | M: +64 21 222 3569 | E:
cameron.hart at flowsoftware.co.nz
PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
www.flowsoftware.co.nz

This message is intended for the addressee named above. It may contain
privileged or confidential information. If you are not the intended
recipient of this message you must not use, copy, distribute or disclose
it to anyone.

Please consider the environment before printing this email


-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Sandeep Chandra
Sent: Thursday, 10 December 2009 12:28 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Make all possible unique combinations

I don't remember changing my name to Sandra from Sandeep!



----- Original Message ----
From: Cameron Hart <Cameron.Hart at flowsoftware.co.nz>
To: NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
Sent: Thu, 10 December, 2009 12:20:02 PM
Subject: Re: [DUG] Make all possible unique combinations

Hi Sandra

Perhaps if you share your existing algorithm we can help you faster.

Cameron Hart | Development Manager | Flow Software Limited
P: +64 9 476 3579 | M: +64 21 222 3569 | E:
cameron.hart at flowsoftware.co.nz
PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
www.flowsoftware.co.nz

This message is intended for the addressee named above. It may contain
privileged or confidential information. If you are not the intended
recipient of this message you must not use, copy, distribute or disclose
it to anyone.

Please consider the environment before printing this email

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Sandeep Chandra
Sent: Thursday, 10 December 2009 11:47 a.m.
To: delphi at delphi.org.nz
Subject: [DUG] Make all possible unique combinations

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




_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe





_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe



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

Message: 5
Date: Wed, 9 Dec 2009 15:38:17 -0800 (PST)
From: Sandeep Chandra <sandeep_groups at yahoo.com>
Subject: Re: [DUG] Make all possible unique combinations
To: rchan at compuspec.com,	NZ Borland Developers Group - Delphi List
	<delphi at delphi.org.nz>
Message-ID: <684297.31210.qm at web30906.mail.mud.yahoo.com>
Content-Type: text/plain; charset=utf-8

Sorry, I can't use for as the number of arrays can change.

Sandeep



----- Original Message ----
From: Rodney Chan <rchan at compuspec.com>
To: delphi at delphi.org.nz
Sent: Thu, 10 December, 2009 12:28:52 PM
Subject: [DUG]  Make all possible unique combinations

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
*************************************

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe







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

Message: 6
Date: Wed, 9 Dec 2009 15:41:52 -0800 (PST)
From: ROHIT GUPTA <r.gupta at xtra.co.nz>
Subject: Re: [DUG] Make all possible unique combinations
To: NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
Message-ID: <368947.74026.qm at web96111.mail.aue.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Bet you dont remember the sex change operation either? :-)

 Your problem however, needs more information.? If all you are doing is
generating the string but not changing it, then a function with two
arguments will do it.? If you are talking about storage then its another
story

--- On Thu, 10/12/09, Sandeep Chandra <sandeep_groups at yahoo.com> wrote:

From: Sandeep Chandra <sandeep_groups at yahoo.com>
Subject: Re: [DUG] Make all possible unique combinations
To: "NZ Borland Developers Group - Delphi List" <delphi at delphi.org.nz>
Date: Thursday, 10 December, 2009, 12:28 PM

I don't remember changing my name to Sandra from Sandeep!



----- Original Message ----
From: Cameron Hart <Cameron.Hart at flowsoftware.co.nz>
To: NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
Sent: Thu, 10 December, 2009 12:20:02 PM
Subject: Re: [DUG] Make all possible unique combinations

Hi Sandra

Perhaps if you share your existing algorithm we can help you faster.

Cameron Hart | Development Manager | Flow Software Limited
P: +64 9 476 3579 | M: +64 21 222 3569 | E:
cameron.hart at flowsoftware.co.nz
PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
www.flowsoftware.co.nz

This message is intended for the addressee named above. It may contain
privileged or confidential information. If you are not the intended
recipient of this message you must not use, copy, distribute or disclose
it to anyone.

Please consider the environment before printing this email

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Sandeep Chandra
Sent: Thursday, 10 December 2009 11:47 a.m.
To: delphi at delphi.org.nz
Subject: [DUG] Make all possible unique combinations

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


? ? ?

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe



? ? ?

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://listserver.123.net.nz/pipermail/delphi/attachments/20091209/cf9ce45a/
attachment.html

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

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

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



More information about the Delphi mailing list