Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 26 JUL 2003 10:28:06AM Bob Silverstein wrote:

I lifted the following from a posting by Oystein.

"Let's say I have this form with fields X, Y and Z, where

- X is a data field

- Y is symbolic and dependent on X

- Z is symbolic and dependent on Y."

How do you update Z? I change X and use set_property to change Y. However, I have a series of editlines dependent upon the previous one in the series, Z being just the first. I would like to update Y and then trigger the sequential updating of the remaining editlines.

I am trying to use CALCULATE as a subroutine in X's LOSTFOCUS or CHAR event. Does not work. Perhaps I have the syntax wrong (what exactly is the third argument, column number–from the dict for which field?).

Any ideas on how to do this or how to use CALCULATE correctly?

Thanks.


At 26 JUL 2003 12:28PM Donald Bakke wrote:

Bob,

If Z is dependent upon Y and Y is dependent upon X then here are a couple of options that might work better for you:

1. Instead of making Z dependent upon Y directly, take the logic from Y that Z needs and place it directly in Z. That way Z is dependent upon X.

2. If you want to keep Z dependent upon Y (perhaps you so don't have to change two symbolics whenever the logic changes), then include a line in Z that references X. It doesn't have to do anything germain to the symbolic. Its presence will build a direct dependence upon the data field so it should recalculate whenever the value of X changes.

dbakke@srpcs.com

SRP Computer Solutions, Inc.


At 26 JUL 2003 05:15PM Oystein Reigem wrote:

Bob,

If the symbolic field you want to recalculate is in an edit table you use the third argument to tell which column in the edit table is bound to the field. You might have read in the help file that the third argument is a column number, but it's "column" as in "edit table control column" (which are numbered 1, 2, … from the left) - not as in "database table field".

- Oystein -


At 26 JUL 2003 09:24PM Bob Silverstein wrote:

Thanks guys. Oystein, unfortunately it is an edit line. As for Don's suggestion, about ten controls are in the sequence and if I have to, then I will change them all from the very first one. Just more script than I thought I had to do.


At 27 JUL 2003 05:39AM Oystein Reigem wrote:

Bob,

I don't think there is a problem in itself with having a sequence of symbolic dependencies.

I made a table with a key field KEY and three fields X, Y and Z, where Y is a symbolic dependent on X, and Z is a symbolic dependent on Y. I then made a form with edit lines for KEY, X, Y and Z.

When I run that form Y and Z automatically calculate twice. It first happens when I tab out of the key field. At that time X=", and that calculation might not be very useful. Then it happens when I'm finished with filling in the X field and tab to the next field. Then both Y and Z get their correct calculated value.

I have some questions for you:

- Why do you use Set_Property to set Y? Automatic calculation should do the job. If for some reason calculation of Y doesn't happen automatically, you should send a CALCULATE message to the Y control. If necessary you should follow that with a CALCULATE message to the Z control, and - in your case - to each of the following fields in correct sequence.

- Have you got that LOSTFOCUS handler on X for other reasons than setting Y?

- You also mention CHAR. Does that mean you want to recalculate Y, Z, etc, for each keystroke in the X field?

- Oystein -


At 28 JUL 2003 11:49AM Bob Silverstein wrote:

Bob Orsini solved this one and made it look embarassingly easy.

In the first control's LOSTFOCUS, just put a SEND_EVENT('NEXT', 'LOSTFOCUS'). NEXT is the next control and then all the other controls dependent on it recalculate automatically.

Thanks Bob.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/f64e22e97ce18c5985256d6f004f7a5d.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1