[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Sep 13 22:25:23 2003 
Subject:Re: Poplog DLL & Other Issues 
From:Richard 
Volume-ID:1030913.02 

>
> >Question 2
> >Is there a way to determine if one variable is dependent on another? To
> >explain what I mean, image a spreadsheet:
> >
> >A1=5  and  A2=A1+2
> >
> >When I change A1, the interpreter knows that A2 is a decendent of A1 and
> >automatically calculates and displays a new result for A2.
> >
> >Anyone have any ideas on how to emulate this behavior in poplog?
>
> If you know A2 always depends on A1, as you describe, then this is
> commonly done by defining a function, as, for example,
>   define A2(); A1 + 2; enddefine;
> If A1 may itself be dependent on something, you could make them
> both be functions:
>   define A1(); 5; enddefine;
>   define A2(); A1() + 3; enddefine;
>
> Notice that this time the definition of A2() uses A1() not A1. If
> you don't see why, then that makes a difference to what kinds of
> answer you were looking for to your original question.
>
> You can make all your "spreadsheet" variables be functions, as above,
> where the formula is put into the function definition. You will run
> into probems if you have circular dependencies, e.g. A1=A2+3, A2=A1-3,
> which a spreadsheet would complain about.
>
> If all the above was obvious, or doesn't answer your question, then
> please try to rephrase your question so we can understand it better.
>

Thanks for your time, but my question isn't quite answered. However, since
your post I have found VCalc in the poplog distribution, which appears to
implement a spreadsheet type interface with auto recalc. I am thinking that
the algorithms in there may answer my questions.

Thanks again.