borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (An activex that cud change list items)Next Topic (linking 3 tables) New Topic New Poll Post Reply
AndreaVB Forum : Database : Comparing 2columns of array in MSflexgrid
Poster Message
OLUPHEMMY
Level: Whizz Kid

Registered: 22-05-2007
Posts: 15

icon Comparing 2columns of array in MSflexgrid

I have been designing database related programs using VB6, but I'm now designing an engineering program that will take input from array of rows and columns in MSFLEXGRID I was successfully coded the msflexgrid to take input that is saved to a file and I have done some calculations and result saved in another column. MY PROBLEM NOW LIES IN COMPARING THE VALUE OF IST TWO COLUMNS VALUE. I.E IF THE VALUE OF COLUMN 1=VALUE OF COLUMN 2. A PARTICULAR CONDITION MUST BE MET. E.G
My required result is shown below
COL1,   COL2....................COL8 , COL9
1            2                           0.5     0
2            5 *                       -0.8   -0.3
5            6                          -0.5     0
6            1                           0.9     0
2            3                           0.5     0
3            4                           0.4     0
4            5                           0.5     0
5            2 *                        0.3    0.8
Any row where there is no change of number like 2 & 5, 5 & 2
the result should be zero while the value of the rows where there is change of same number there will be change of Col8 value and sign as shown above.
Please help me to get this result
This is the code I used but i'm not getting the required result.

For i=1 to HowBig
For j=1 to HowBig
  If NodeFrom(i)=NodeTo(j) And NodeTo(i)=NodeFrom(j) Then
PipeDeltaQ(j) = PipeDeltaQ(j)-LooDeltaQ(WLoop(I))End If
grid.TextMatrix(I,9) = PipeDeltaQ(j)
Nextj
Next i


Note all variables are declared and PipeDeltaQ(i) has been calculated for in Col8.
I know you will help me it has been delaying me for weeks now. If somebody need the whole code I will send it to your email address.
Thanks in serious Anticipation

OLUPHEMMY

[Edited by OLUPHEMMY on 22-05-2007 at 01:54 PM GMT]

[Edited by admin on 22-05-2007 at 02:45 PM GMT]

22-05-2007 at 12:38 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Comparing 2columns of array in MSflexgrid

Hi,
Can you be a bit clearer?
I note from your code that if COL1=COL2 and COL2=COL1 then you do something.. is that correct?

Can you update your example? You say "if there is no change, then the value should be zero", however, your table clearly shows values of 0.3 and 0.8 ro COL8 and COL9.

What is the value of the 1st 2 columns value?
What condition must be met?

It would be helpful if you gave a walkthrough of your calculations and results.

Example:

Row  Value1  Value2
1      1           2      
Value1 = Value2, therefore no calculation required

Row  Value1  Value2
2      2           5
Value1 <> Value2, therefore calculation required, etc.

Thanks
Kieron

  

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

09-07-2007 at 09:35 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Comparing 2columns of array in MSflexgrid
Previous Topic (An activex that cud change list items)Next Topic (linking 3 tables) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder