• from the hints and kinks department

    From Richard Webb@1:116/901 to all on Thu Apr 21 15:00:58 2011
    HI folks,

    I've been ahving so much fun!!!

    Revamping my ham radio net control logger a little bit,
    easier menu driven interface for not regular users, and for
    Kathy without having to write separate programs for both of
    us.

    ONe of the legal requirements is that one identifies his/her ham station at ten
    minute intervals or more frequent here in the U.S>

    so, various menu items plug the minutes past the hour in a
    file which we can then plug into an environment variable
    using HOrst's nset.

    So I'm using TImo's function evaluator to subtract the
    number %ID% captured from this file from current minutes
    past the hour (stuffed into another env var) and think this
    should be real simple. Just have the next line in the batch do

    fn /b %COUNTER%-%ID% >> checknum.txt

    tHen of course we remove the decimal point from checknum.txt and replace it with white space, so we can
    stuff that whole number into another env var for ifnumber to chew on compared against the value of %LEGAL% which will of
    course be ten.

    But, Timo's function evaluator was giving me weird numbers,
    almost like it couldn't add or subtract anymore.

    So, we played with it in test mode for awhile, then
    discovered that if we express the equation fully algebraic
    as in

    fn /b %COUNTER%+-%ID% >> checknum.txt

    we suddenly get the right answer.

    <arrrrgh>

    Fun with my morning coffee.




    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)
  • From Paul Quinn@3:640/384 to Richard Webb on Fri Apr 22 09:48:00 2011
    Hi! Richard,

    In a message to All you wrote:

    But, Timo's function evaluator was giving me weird numbers,
    almost like it couldn't add or subtract anymore.

    So, we played with it in test mode for awhile, then discovered that
    if we express the equation fully algebraic as in

    fn /b %COUNTER%+-%ID% >> checknum.txt

    we suddenly get the right answer.

    I had nearly the same problem about two years ago, when I was doing some simple
    text file manipulation with newsgroup posts (really, really simple stuff BTW).
    You may recall that I like to use Greg Miskelly's PSIS.COM in a lot of my batches for simple maths functions(?). Well, back then I found it was either not working at all or was giving strange results (can't recall). I ended up having to resort to using Horst's COUNT.COM instead. Not that I mind doing that, of course. In fact, the only external utils I used in the batch besides FIND were all Horst's: COUNT, LMOD & NSET. [big grin]

    <arrrrgh>

    Yep, and much teeth grinding, nail biting & hair pulling no doubt. Been there;
    done that.

    Fun with my morning coffee.

    Thank you. I was just enjoying mine too.

    Cheers,
    Paul.

    ---
    * Origin: C code. C code run. Run code, run!@?#$%?&*! (3:640/384)
  • From Richard Webb@1:116/901 to Paul Quinn on Fri Apr 22 13:17:34 2011
    Hi Paul,

    On Fri 2039-Apr-22 09:48, Paul Quinn (3:640/384) wrote to Richard Webb:

    But, Timo's function evaluator was giving me weird numbers,
    almost like it couldn't add or subtract anymore.

    <snip>
    I had nearly the same problem about two years ago, when I was doing
    some simple text file manipulation with newsgroup posts (really,
    really simple stuff BTW). You may recall that I like to use Greg Miskelly's PSIS.COM in a lot of my batches for simple maths
    functions(?). Well, back then I found it was either not working at
    all or was giving strange results (can't recall). I ended up having
    to resort to using Horst's COUNT.COM instead. Not that I mind doing
    that, of course. In fact, the only external utils I used in the
    batch besides FIND were all Horst's: COUNT, LMOD & NSET. [big grin]

    I use HOrst's count for a lot of things. I.e. look for a
    text string with fgrep or find, plug that line number into
    an environment variable, use HORst's count to then bump that number back or forward, plug the resulting number in as a
    place for Sed to grab from a text file, etc.

    I've gotten tired of doing two different systems for net
    control work, one mostly menu driven for Kathy when she uses the station, another for myself.
    I don't use the same one she uses as it chatters too much
    with the speech. Also, I added some other wrinkles to it,
    which hopefully keep me on task a little better when it's
    slow.


    Yep, and much teeth grinding, nail biting & hair pulling no doubt.
    Been there; done that.

    Fun with my morning coffee.

    Thank you. I was just enjoying mine too.

    YEah, and that idea hit me about 3 in the morning trying to
    get Kathy squared awy after a little difficulty, I'm lying
    there trying to go back to sleep and the idea hit me that a
    legal id checker would be a simple thing to roll into this,
    figured half hour of coding should rock 'n roll, so I read
    my mail, coded it up and decided I'd plug in some testing.

    WERen't that simple, until I figured out that TImo's
    function evaluator likes the equation shown as addition etc. OH well.


    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)