[Remind-Fans] Modifying Borrowed Function

Justin Alcorn justin at jalcorn.net
Tue Nov 18 22:50:24 EST 2008


Sorry:

The last line of .curweight looks like:

fset _curweight() 275


On Tue, Nov 18, 2008 at 10:49 PM, Justin Alcorn <justin at jalcorn.net> wrote:

> INCLUDE /home/xxxxxxx/.curweight
> fset _wtweeks() coerce("STRING", (trigdate()-today())/7) +
> plural((trigdate()-today())/7, " week")
> fset _wtweeksnum() choose((trigdate()-today())/7,1,(trigdate()-today())/7)
> fset _wtdays() coerce("STRING", (trigdate()-today())) +
> plural((trigdate()-today()), " day")
> # 2 pounds per week
> fset _pounds() coerce("STRING", (2*(trigdate()-today())/7)) +
> plural(2*((trigdate()-today())/7), " pound")
> fset _finweight() coerce("STRING",
> (_curweight()-(2*(trigdate()-today())/7)))
> # Set weight
> fset _initweight() 280
> fset _pounds() coerce("STRING", (_curweight() - _finweight()) +
> plural(_curweight() - _finweight(), " pound"))
> fset _sofar() coerce("STRING", (_initweight() - _curweight()) +
> plural(_initweight() - _curweight(), " pound"))
> fset _togo() _curweight() - _finweight()
> fset _perweek() coerce("STRING",((_togo() / _wtweeksnum())+1) +
> plural(((_togo() / _wtweeksnum())+1), " pound"))
> #fset _wtoutput() coerce("STRING", _finweight() + " by " + _trigdate() + ".
> You have " + _wtdays() + " (" + wtweeks() + ") to lose "+ _pounds() + ",
> almost " + _perweek() + " per week")
> fset _wtoutput() "Goal: " + coerce("STRING", _finweight() + " by " +
> trigdate() + ". You have " + _wtdays() + " (" + _wtweeks() + ") to lose " +
> _pounds() + ", almost " + _perweek() + " per week!" )
> MSG Last Weigh-In [Blu] [_curweight()] [Nrm]
> [REALTODAY()-FILEDATE("/home/xxxxx/.curweight")] days ago. %"%"%
> REM MSG You have lost [_sofar()] in [trigdate() - '2008/01/01'] days, or
> [(_initweight() - _curweight())/((trigdate() - '2008/01/01')/7) + 1] lbs per
> week. %"%"%
> REM MSG You have lost [_sofar()]%"%"%
> REM Jan 2 2009 +90 MSG You are on track to weigh [_curweight() -
> ((_wtweeksnum())*2)] pounds on [trigdate()] %"%"%
> fset _finweight() 220
> REM Dec 31 2009 +400 MSG [_wtoutput()] %"%"%
>
>
>
>
> On Tue, Nov 18, 2008 at 9:41 PM, Jorge Luis <lists at jorge.cc> wrote:
>
>> I found the following ostensibly useful function at 43Folders, but I
>> can't figure out how to store the needed values in _finweight() (or any
>> of the other functions except _curweight().  Anyone willing to rap me
>> with the cluebat?
>>
>> # more elaborate date-based math (example: weight goal)
>>
>> fset _curweight() 240
>> fset _wtweeks() coerce("STRING", (trigdate()-today())/7) +
>> plural((trigdate()-today())/7, " week")
>> fset _wtdays() coerce("STRING", (trigdate()-today())) +
>> plural((trigdate()-today()), " day")
>> fset _pounds() coerce("STRING", (2*(trigdate()-today())/7)) +
>> plural(2*((trigdate()-today())/7), " pound")
>> fset _finweight() coerce("STRING",
>> (_curweight()-(2*(trigdate()-today())/7))) +
>> plural(2*((trigdate()-today())/7), " pound")
>>
>> REM 18 Nov 2009 +365 MSG Goal is to go from [_curweight()] to
>> [_finweight()] by November 18.
>> REM You have [_wtdays()] ([_wtweeks()]) to lose [_pounds()]!
>>
>> Thanks for any help!
>>
>>        JL
>>
>> --
>> JL <lists at jorge.cc>
>> This message optimized for teletypes.
>>
>> _______________________________________________
>> Remind-fans mailing list
>> Remind-fans at lists.whatexit.org
>> http://lists.whatexit.org/mailman/listinfo/remind-fans
>>
>
>
>
> --
> Justin B. Alcorn
> The views expressed here are not necessarily my own, much less anyone
> else's.
>
>


-- 
Justin B. Alcorn
The views expressed here are not necessarily my own, much less anyone
else's.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20081118/7f9c09c2/attachment.htm>


More information about the Remind-fans mailing list