I solve this problem with the samples!
(because my development environment is offline, I haven't seen the sample stacks. )
Best regards,
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Just in case yochankim is too new to know how to get to the user samples, you can either get there in the LiveCode environment from the menubar icon "User Samples" or directly through the web browser at http://livecodeshare.runrev.com/
Code: Select all
on mouseup
put fld 1 into arg
put integrate(arg,"x") into fld 2
end mouseup
function integrate arg,var
set the itemDel to var
put item 1 of arg into coeff
if coeff = "" or coeff = 1 then put "" into coeff
put item 2 of arg into everythingElse
if everythingElse contains "^" then
set the itemDel to "^"
put word 1 of item 2 of everythingElse into expon
put word 2 of everythingElse into operator
put word 3 of everythingElse into const
else
put 1 into expon
put word 1 of everythingElse into operator
put word 2 of everythingElse into const
end if
add 1 to expon
if coeff ="" then return coeff & var & "^" & expon && "/" && expon && operator && const & var && "C"
else return coeff / expon & var & "^" & expon && operator && const & var && "C"
end integrate