RogGuay wrote: Wed Mar 06, 2019 6:11 am
I have stack that I uploaded to LiveCode Sample Stack called Coup de Graph. It may give you some ideas.
Cheers,
Roger
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/
Your sample was right at the top Roger, congrats !
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
Craig
Last edited by dunbarx on Wed Mar 06, 2019 6:18 pm, edited 2 times in total.