Problems with a calculation
Posted: Thu Oct 30, 2008 11:35 pm
The following script hangs up in line 13. I put everything into variables to make it easy to read but can't see whats wrong with the line that stops putting the calculated Qty into an item of a line in a table field:
Code: Select all
on mouseUp
if item 1 of line 6 of fld "Substrates" = "" then
answer "You need to enter substrate details before calculating adhesive requirements"
exit mouseup
else
put item 1 of line 6 of fld "substrates" into tlength
put item 1 of line 3 of fld "substrates" into twidth
Set itemdelimiter to tab
repeat with n = 1 to the number of lines in fld "Adhesives"
put item 7 of line n of fld "Adhesives" into tGSM
put item 4 of line n of fld "Adhesives" into tratioA
put item 6 of line n of fld "Adhesives" into tratioB
put tratioA + tratioB into tTotal
put tlength * twidth / 1000 * tGSM * tratioA / tTotal into item 9 of line n of fld "Adhesives"
put tlength * twidth / 1000 * tGSM * tratioB / tTotal into item 10 of line n of fld "Adhesives"
end repeat
end if
end mouseUp