General information
Category:
Coding, syntax & commands
>>I'm down to 2 problems.
>>now i'm dealing with a variable not found issue. I'm Putting:
>>
>
>The problem here is that the default scoping of vars is PRIVATE. That means the the vars are available in the method where they are created and any method called from that method. One way around this is to store those values in form properties. Form properties are available to all the objects contained in the form.
>
>While in the form designer, click the Form menu item, then click add property. A dialog will be displayed. Add the new property name and click ok. If you look in the property sheet under Other you will see your new properties.
>
>Now change the code in the IAC method to:
>
>Thisform.lnCol2Value = This.aList(This.ListItemID, 2)
>Thisform.lnCol3Value = This.aList(This.ListItemID, 3)
>
>Now each time the user clicks on a value in the combo the form property will contain those values.
>
>NOTE: You can use THIS to have an object refer to itself. So in the IAC this.alist is the same as thisform.c21.alist
>
>Now we can change the function that has the error to:
>
>Thisform.txt3.Value = val(thisform.c11.Displayvalue)* thisform.lnCol2Value * thisform.lnCol3Value * val(thisform.c31.Displayvalue)
>
>And that should fix it up.
>
>BTW you should try to name you objects and vars a little more descriptively.
>
>lnCol2Value is pretty meaningless where nBoardSize tells you exactly what it is.
>
>I couldn't find your other post so I'm not exactly sure what your trying to accomplish but this should help you out.
>
>
>>The second problem is that i need to use values that the user inputs in a text box in some of my calculations and am not sure how to approach it.
>>
>
>Just use thisform.MyTextBox.value
This is my code in the combo "c21" init event:
This.AddProperty('aList[1]')
Dimension This.aList[5,3]
with This
.aList[1,1] = "2x4"
.aList[1,2] = 192
.aList[1,3] = .667
.aList[2,1] = "2x6"
.aList[2,2] = 128
.aList[2,3] = 1
.aList[3,1] = "2x8"
.aList[3,2] = 96
.aList[3,3] = 1.33
.aList[4,1] = "2x10"
.aList[4,2] = 80
.aList[4,3] = 1.67
.aList[5,1] = "2x12"
.aList[5,2] = 64
.aList[5,3] = 2
.RowSourceType = 5
.RowSource = "this.aList"
.ColumnCount = 3
.ColumnWidths = "50,0,0"
endwith
This is my coding in all involved combos interactivechange event:
ThisForm.lnCol2Value = ThisForm.c21.aList(This.ListItemID, 2)
ThisForm.lnCol3Value = ThisForm.c21.aList(This.ListItemID, 3)
&& BOARDFOOTAGE
Thisform.txt2.Value = val(thisform.c11.Displayvalue) * ThisForm.lnCol2Value * ThisForm.lnCol3Value * val(thisform.c31.Displayvalue)
&& LINEAL BOARDFEET
Thisform.txt2.Value = val(thisform.c11.Displayvalue) * ThisForm.lnCol3Value * val(thisform.c31.Displayvalue)
there are 3 combos, one with values 1-20, the second with the previously mentioned array, and the third with even numbers through 20.
if i select the 1st available value in each combo i should get 1*192*.667*2 which equals 256.128 (truncated to 256) for the boardfootage function. instead i get 1. for the lineal function, i get a big goose-egg.
i apologize for not posting enough information. that's a rookie for ya.
Thanks
JD
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only