|
-
Nov 11th, 2009, 05:59 AM
#1
Thread Starter
New Member
how to find pairs of n-variables
Hello everybody.!!
I am very new to VB. I need to prepare an interface in VB6 where I have some variables like a1, a2, a3, a4...etc.
i need the pairs of them like (a1,a2), (a1,a3),(a1,a4),(a2,a3),(a2,a4),(a3,a4).
etc...
and have to enter another 6 values for each pair manually.
So i will be great full to u all if anybody suggest any idea........
with regards
Badwl
NITW
-
Nov 11th, 2009, 06:43 AM
#2
Re: how to find pairs of n-variables
Thread moved from the 'VB.Net' (VB2002 and later) forum to the 'VB6 and Earlier' forum
-
Nov 11th, 2009, 07:49 AM
#3
Re: how to find pairs of n-variables
Not sure exactly what you're after...
When you say "I need the pairs of them..." what do you mean?
You want some text boxes in which to enter the numbers? Then do what with them?
-
Nov 11th, 2009, 09:32 AM
#4
Re: how to find pairs of n-variables
How about an array of UDTs
Private Type TPair
V1 As Long
V2 As Long
End Type
Private Pairs() As TPair
Private PairCount As Long
-
Nov 11th, 2009, 12:12 PM
#5
Thread Starter
New Member
Re: how to find pairs of n-variables
 Originally Posted by vbfbryce
Not sure exactly what you're after...
When you say "I need the pairs of them..." what do you mean?
You want some text boxes in which to enter the numbers? Then do what with them?
actually i am not sure what exactly it say... but if u have variables like a1, a2, a3, a4,....etc. then how to find the pairs (a1,a2), (a1,a3), (a1,a4),(a2,a3),(a2,a4),(a3,a4)......and so on......which algorithm should I use for that?
and after that one window(form) should come like
..........+X +Y +Y -X -Y -Z
a1,a2...[ ] [ ] [ ] [ ] [ ] [ ]
:
:
and so on.......
-
Nov 11th, 2009, 05:40 PM
#6
Re: how to find pairs of n-variables
I'm sorry but in order for us to help you you'll need to give a better explanation of what you want to do.
What do you mean when you say "pairs"? You say you have variables named a1, a2, etc. Do you want to somehow find the variables themselves or do you want to find the values of the variables? In either case how do you decide if it's a "pair"?
And the following I'm sorry to say makes no sense at all. What are the Xs, Ys and Zs? And what are the + and - signs? And the brackets?
..........+X +Y +Y -X -Y -Z
a1,a2...[ ] [ ] [ ] [ ] [ ] [ ]
:
:
-
Nov 12th, 2009, 12:50 AM
#7
Re: how to find pairs of n-variables
If your application has a database engine then you can let the database ngine do the cartesian join rather than worrying about algorithm.
SELECT a.column_value, b.column_value
FROM your_table a
, your_table b
WHERE b.seq_no > a.seq_no -- this eliminates pairs like (a1,a1) and duplicates, e.g. (a1, a2) and (a2, a1), from result since you will be joining current record only to records that come after it
-
Nov 12th, 2009, 03:16 AM
#8
Thread Starter
New Member
Re: how to find pairs of n-variables
 Originally Posted by leinad31
If your application has a database engine then you can let the database ngine do the cartesian join rather than worrying about algorithm.
SELECT a.column_value, b.column_value
FROM your_table a
, your_table b
WHERE b.seq_no > a.seq_no -- this eliminates pairs like (a1,a1) and duplicates, e.g. (a1, a2) and (a2, a1), from result since you will be joining current record only to records that come after it
leinad31 Sir ,
Thank you.....very much ... It will be very much helpful to my project works...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|