Download the free trial version
Questions (Windows Mobile) Post any question regarding Basic4ppc.
Help on Table1.Cell,SelectedCol?
07-09-2008, 06:46 PM
Knows the basics
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Help on Table1.Cell,SelectedCol?
Don't let the title confuse you.
What I have is a Table that has four Col with four Rows.
Each Col has one Cell that is a constant as do the Rows which corresponds with
the Col all other Cell in Col/Row are varibels.
Each Cell in one Col must equal or less then the constant or move on to the next
Col.
What I have now works great but I have to decipher between which of the four col that I need to use(no big deal to me).
What I would like to do is have PPC put the right Col In my hand without thinking about it.Like putting that information into four TextBox'es on a Form.
This is what I'm operating with now.
Code:
Sub ImageButtonGetPercent3_Click TextBoxPercent100.Text=TextBoxHopper1.Text+TextBox Hopper2.Text+TextBoxHopper3.Text+TextBoxHopper4.Te xt If TextBoxPercent100.Text= 100 Then Table1.Cell(" A " , 0 )= 1026 Table1.Cell(" B " , 1 )= 438 Table1.Cell(" C " , 2 )= 140 Table1.Cell(" D " , 3 )= 116 ImageButtonResin3.BringToFront ImageButtonExitResin.BringToFront InitializeConfigResinElse Msgbox ( " Pecntage Must Equal 100% " , "" ,cMsgBoxOK,cMsgBoxHand) End If End Sub Sub InitializeConfigResin Table1.Cell( " A " , 1 )=(Table1.Cell( " A " , 0 )*TextBoxHopp er2.Text)/TextBoxHopper1.Text Table1.Cell( " A " , 2 )=(Table1.Cell( " A " , 0 )*TextBoxHopp er3.Text)/TextBoxHopper1.Text Table1.Cell( " A " , 3 )=(Table1.Cell( " A " , 0 )*TextBoxHopp er4.Text)/TextBoxHopper1.Text Table1.Cell( " B " , 0 )=(Table1.Cell( " B " , 1 )*TextBoxHopp er1.Text)/TextBoxHopper2.Text Table1.Cell( " B " , 2 )=(Table1.Cell( " B " , 1 )*TextBoxHopp er3.Text)/TextBoxHopper2.Text Table1.Cell( " B " , 3 )=(Table1.Cell( " B " , 1 )*TextBoxHopp er4.Text)/TextBoxHopper2.Text Table1.Cell( " C " , 0 )=(Table1.Cell( " C " , 2 )*TextBoxHopp er1.Text)/TextBoxHopper3.Text Table1.Cell( " C " , 1 )=(Table1.Cell( " C " , 2 )*TextBoxHopp er2.Text)/TextBoxHopper3.Text Table1.Cell( " C " , 3 )=(Table1.Cell( " C " , 2 )*TextBoxHopp er4.Text)/TextBoxHopper3.Text Table1.Cell( " D " , 0 )=(Table1.Cell( " D " , 3 )*TextBoxHopp er1.Text)/TextBoxHopper4.Text Table1.Cell( " D " , 1 )=(Table1.Cell( " D " , 3 )*TextBoxHopp er2.Text)/TextBoxHopper4.Text Table1.Cell( " D " , 2 )=(Table1.Cell( " D " , 3 )*TextBoxHopp er3.Text)/TextBoxHopper4.Text ButtonA2.Text=(Table1.Cell( " A " , 1 )/Table1.Cell( " B " , 1 ))* 100 ButtonA3.Text=(Table1.Cell(" A " , 2 )/Table1.Cell( " C " , 2 ))* 100 ButtonA4.Text=(Table1.Cell(" A " , 3 )/Table1.Cell( " D " , 3 ))* 100 ButtonB1.Text=(Table1.Cell(" B " , 0 )/Table1.Cell( " A " , 0 ))* 100 ButtonB3.Text=(Table1.Cell(" B " , 2 )/Table1.Cell( " C " , 2 ))* 100 ButtonB4.Text=(Table1.Cell(" B " , 3 )/Table1.Cell( " D " , 3 ))* 100 ButtonC1.Text=(Table1.Cell(" C " , 0 )/Table1.Cell( " A " , 0 ))* 100 ButtonC2.Text=(Table1.Cell(" C " , 1 )/Table1.Cell( " B " , 1 ))* 100 ButtonC4.Text=(Table1.Cell(" C " , 3 )/Table1.Cell( " D " , 3 ))* 100 ButtonD1.Text=(Table1.Cell(" D " , 0 )/Table1.Cell( " A " , 0 ))* 100 ButtonD2.Text=(Table1.Cell(" D " , 1 )/Table1.Cell( " B " , 1 ))* 100 ButtonD3.Text=(Table1.Cell(" D " , 2 )/Table1.Cell( " C " , 2 ))* 100 TextBoxSum1.Text=Table1.Cell(" A " , 0 )+Table1.Cell( " A " , 1 )+Table1.Cell( " A " , 2 )+Table1.Cell( " A " , 3 ) TextBoxSum2.Text=Table1.Cell( " B " , 0 )+Table1.Cell( " B " , 1 )+Table1.Cell( " B " , 2 )+Table1.Cell( " B " , 3 ) TextBoxSum3.Text=Table1.Cell( " C " , 0 )+Table1.Cell( " C " , 1 )+Table1.Cell( " C " , 2 )+Table1.Cell( " C " , 3 ) TextBoxSum4.Text=Table1.Cell( " D " , 0 )+Table1.Cell( " D " , 1 )+Table1.Cell( " D " , 2 )+Table1.Cell( " D " , 3 ) InitializeRound End Sub Sub InitializeRound ButtonA2.Text= Round (ButtonA2.Text, 0 ) ButtonA3.Text= Round (ButtonA3.Text, 0 ) ButtonA4.Text= Round (ButtonA4.Text, 0 ) ButtonB1.Text= Round (ButtonB1.Text, 0 ) ButtonB3.Text= Round (ButtonB3.Text, 0 ) ButtonB4.Text= Round (ButtonB4.Text, 0 ) ButtonC1.Text= Round (ButtonC1.Text, 0 ) ButtonC2.Text= Round (ButtonC2.Text, 0 ) ButtonC4.Text= Round (ButtonC4.Text, 0 ) ButtonD1.Text= Round (ButtonD1.Text, 0 ) ButtonD2.Text= Round (ButtonD2.Text, 0 ) ButtonD3.Text= Round (ButtonD3.Text, 0 ) TextBoxSum1.Text= Round (TextBoxSum1.Text, 0 ) TextBoxSum2.Text= Round (TextBoxSum2.Text, 0 ) TextBoxSum3.Text= Round (TextBoxSum3.Text, 0 ) TextBoxSum4.Text= Round (TextBoxSum4.Text, 0 ) PanelGetResin.BringToFront Form2.Show End Sub
07-10-2008, 05:49 PM
Knows the basics
Join Date: Aug 2007
Location: Arkansas
Posts: 68
All I need is help on how to call up the three cell's that are variables.Thats all.
In each Col.
Last edited by cdeane : 07-10-2008 at 05:52 PM .
07-10-2008, 06:33 PM
Administrator
What do you mean with "three cell's that are variables"? Can you give a small example?
07-10-2008, 07:25 PM
Knows the basics
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Table1.Cell=
ID A B C D
0 1026 0 0 0
1 0 438 0 0
2 0 0 140 0
3 0 0 0 116
All "0" are variables.
Col("A",0)'Is a Constant
Col("B",1)'Is a Constant
Col("C",2)'Is a Constant
Col("D",3)'Is a Constant
All "0" Increase or Decrease(variable)
I hope I'm right in the definition.
Last edited by cdeane : 07-10-2008 at 07:27 PM .
Reason: Spacing
09-09-2008, 05:53 PM
Junior Member
Join Date: Aug 2008
Posts: 14
I got it
I knew i was missing something, i just figured it out.
I was trying to do the code without puting the control on the form.
I am not the brightest bulb. Hopefully you wont hear from me until i have a finished product. Again i really appreciate your guidance.
sue
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 10:02 AM .