Combinations of sets
From: Jostein (jostein.solstad_at_gmail.com)
Date: 10/19/04
- Next message: Maarten Wiltink: "Re: How to verify the current date?"
- Previous message: Justus J.: "Re: How to verify the current date?"
- Next in thread: Bruce Roberts: "Re: Combinations of sets"
- Reply: Bruce Roberts: "Re: Combinations of sets"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 Oct 2004 08:14:45 -0700
Hi.
Anyone know how i can write this code if i dont know the number of
sets.
In my working example each set will represent a loop. Sets could be
[Blue,Red] [Large,Small,Very Small] [Oval,Square]. The below would
list all the combinations (Blue-Large-Oval is one) correctly. Prolbem
is that i cant say there is 3 sets, there could be 4,5 or whatever.
for i1 := 0 to AttrArray[0].Count-1 do
begin
for i2 := 0 to AttrArray[1].Count-1 do
begin
for i3 := 0 to AttrArray[2].Count-1 do
begin
combs := AttrArray[0].Strings[i1].ToString + ' ' +
AttrArray[1].Strings[i2].ToString + ' ' +
AttrArray[2].Strings[i3].ToString;
Response.Write(combs+'<br>');
end;
end
end;
Thank you for any help. Im stuck on this :(
- Next message: Maarten Wiltink: "Re: How to verify the current date?"
- Previous message: Justus J.: "Re: How to verify the current date?"
- Next in thread: Bruce Roberts: "Re: Combinations of sets"
- Reply: Bruce Roberts: "Re: Combinations of sets"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|