Trying a custom handler for several math fields

Vaughn Clement vclement at gmail.com
Sun Sep 15 15:40:03 EDT 2013


Hi Geoff

This is an example of the fields in the handler that need to be in the
calculation, and when the calculation start the $ will produce an error
because the $ is in the field. So, the $ needs to be removed, and calc is
done, then the $ is put back into the several fields.

   put fld "Loan1" + fld "Loan2" into fld "Loan Balance"
   put fld "Vehicle Selling Price" - fld "Buyers Offer Discount" into fld
"Net Offer Price"
   put fld "Net Offer Price" + fld "Buyers Options Cost" - fld "Factory
Allowance" into fld "Sum of Offer"
   put fld "Sum of Offer" - fld "Buyers Accepted Trade" into fld "Net Amt
after Payoff"
   put fld "Net Amt after Payoff" - fld "Buyers Down PMT." into fld
"Balance Before Finance"
   put fld "Balance Before Finance" + fld "Tax" + fld "Plates" + fld "Doc
Fees" + fld "Options Other" into fld "Amount of Loan"
   put fld "Loan Term in Months" * fld "Monthly Payment" into fld "Sum of
Loan at Term"
   put fld "Amount of Loan" - fld "Sum of Loan at Term" into fld "Interest
Paid at Term"

Thank you

Vaughn Clement

Apps by Vaughn Clement (Support)
*http://www.appsbyvaughnclement.com/tools/home-page/*
Skype: vaughn.clement
https://secure.join.me/appsbyvclement
FaceTime: vclement at gmail.com
LogMeIn also avaialble
Call on "ooVoo" at address:  vaughnclement or 9282549062
Ph. 928-254-9062
Cloud Hosting Registration Web Site:
https://my.oditech.com/cart.php?a=add&pid=41


On Sun, Sep 15, 2013 at 12:35 PM, Vaughn Clement <vclement at gmail.com> wrote:

> Hi Geoff
>
> For the new developer, can you explain what the script is doing in more
> detail?
>
>
> Thank you
>
> Vaughn Clement
>
> Apps by Vaughn Clement (Support)
> *http://www.appsbyvaughnclement.com/tools/home-page/*
> Skype: vaughn.clement
> https://secure.join.me/appsbyvclement
> FaceTime: vclement at gmail.com
> LogMeIn also avaialble
> Call on "ooVoo" at address:  vaughnclement or 9282549062
> Ph. 928-254-9062
> Cloud Hosting Registration Web Site:
> https://my.oditech.com/cart.php?a=add&pid=41
>
>
> On Sun, Sep 15, 2013 at 11:53 AM, Geoff Canyon <gcanyon at gmail.com> wrote:
>
>> In the absence of confirmation from someone looking at the engine code, I
>> wrote a test. Here are two handlers, with comments explaining what I think
>> is going on:
>>
>> on mouseUp
>>    put 1 into X -- X is a number
>>    put 1 into Y -- Y is a number
>>    put the long seconds into T
>>    repeat 9999999
>>       put X into Z -- Z is a number, no conversion
>>       add Z to Y -- Z is a number, no conversion
>>    end repeat
>>    put the long seconds - T
>> end mouseUp
>>
>>
>> on mouseUp
>>    put "1" into X -- X is a string
>>    put 1 into Y -- Y is a number
>>    put the long seconds into T
>>    repeat 9999999
>>       put X into Z -- after the first loop, each time Z has to convert
>> back
>> to a string
>>       add Z to Y -- Z has to be converted to a number
>>    end repeat
>>    put the long seconds - T
>> end mouseUp
>>
>> On my mac, the second handler consistently takes 10% longer to run. Since
>> the handlers are otherwise identical, I have to think string conversion is
>> causing the slowdown, and that in the first handler, nothing is being
>> stored as a string.
>>
>> gc
>>
>>
>> On Sat, Sep 14, 2013 at 11:08 PM, <dunbarx at aol.com> wrote:
>>
>> > Geoff.
>> >
>> >
>> > I could be misRemembering, possibly even in an earlier life (HC), that
>> > variable typing was done by the interpreter at runtime, or in HC 2, at
>> > compile time.
>> >
>> >
>> > Maybe this was changed in LC? Someone here must know...
>> >
>> >
>> > Craig
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Geoff Canyon <gcanyon at gmail.com>
>> > To: How to use LiveCode <use-livecode at lists.runrev.com>
>> > Sent: Sat, Sep 14, 2013 9:10 pm
>> > Subject: Re: Trying a custom handler for several math fields
>> >
>> >
>> > (We agree on all your other points)
>> >
>> > I remember reading many years ago on this mailing list that if you
>> assign a
>> > number  to a variable:
>> >
>> > put 52 into x
>> >
>> > LC stores that variable as a number from the get-go and only converts it
>> > to a
>> > string if needed.
>> >
>> > Sent from my iPad
>> >
>> > On Sep 14, 2013, at 9:22 AM, dunbarx at aol.com wrote:
>> >
>> > > If you add a number to "50", it is then that the engine types the
>> string
>> > as a
>> > number.
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription
>> > preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list