I am using following code to find products of 2 series of numbers and then to find sum of these products:
make-row: func [][
compose [
t1: text "N1:"
f1: field
t2: text "N2: "
f2: field
t3: text "Product: "
t4: text ""
b: button "Get product" [
x: face/extra/2/text
y: face/extra/4/text
z: (to-integer x) * (to-integer y)
face/extra/6/text: rejoin [z]]
do [b/extra: reduce [t1 f1 t2 f2 t3 t4]] ] ]
view compose [
(make-row) return
(make-row) return
b: button "Calculate" [t2/text: "..to be given"]
t1: text "Sum of products:"
t2: text "" ; NEED TO GET SUM OF ALL PRODUCTS IN ABOVE ROWS.
]
The first part is working all right - The products are being calculated properly. But how can I access these individual products to find sum of products? I could not find any way since the rows are not really objects whose public variables or methods/functions I may be able to access. How can this be solved? Thanks for your help.