if you have a program editing the variable you can't do it in real
time: it's updated at the end of each program run.
My view abour TI-Nspire's programming is that a program should be
avoided at all times, unless you plan on calling it and getting output
exclusively from a Calculator app.
So, if you have a G&G page, use functions instead of programs. Call
them from a spreadsheet page and store the result on a variable. Then
recall that result back to the G&G page.
Here's the outline:
1. On a G&G page you have a rectangle triangle and both sides AB and
AC are measured and stored in variables;
2. On a L&S page you have cells A1 and A2 defined as A1=bc, A2=ac;
3. A function pythagoras(l1,l2) returns sqrt(l1^2 + l2^2)
4. define cell A3 as "hyp:=pythagoras(a1,a2)" (this calls the function
and stores the result on variable hyp.
5. back to the G&G page write down text expression "var". Calculate it
using variable hyp as parameter var.
And there you have it, the input is created on the G&G page, the
output is also written to the G&G page and everything in between is
done by functions, with L&S acting as a "transport agent".
Check out the tutorial I wrote about connecting G&G with L&S on
http://nelsonsousa.pt/index.php?lang=en&cat=2&subcat=5&article=36
It uses 3 movable circles and a L&S page computes the coordinates of
the center of mass. With more complex calculations you may need to use
explicit functions (and several of them, as functions on L&S can only
return numbers or lists).
Oh, one last piece of advice: be very carefull with error checking!
When a L&S cell is defined as the result of a function, if the
function returns an error you may lose the definition. If error
checking isn't reliable define a column as the result of the function
and have the function return a list instead of a number.
Cheers,
Nelson