{{tag>category:"OpenInsight 32-Bit" author:"David Kafka" author:"Don Miller - C3 Inc."}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== Writing to @RECORD (OpenInsight 32-Bit) ==== === At 10 APR 2002 01:43:30AM David Kafka wrote: === I am well aware that you can't rely on @RECORD during window processing. My question is this: elements of my ARev app date back to 80286 days. One technique that I learned way back when to speed up window display and RList processing was to have any complex symbolics write to real fields. So, for example, if I had a symbolic {ORDER.TOTAL}in the window, it would write to a field in @RECORD whenever it was executed, and then other calculated fields would use the real field to do their calculation. To make up an example: {ORDER.TOTAL} @ANS =A***B***C***D***E @RECORD=@ANS ; * {TAXABLE.TOTAL} this seems to do nothing in OI RETURN @ANS {TOTAL.TAX} @ANS={TAX.RATE} * {TAXABLE.TOTAL} RETURN @ANS Thus, {TOTAL.TAX} does not have to redo the {TAXABLE.TOTAL} calculation. {ORDER.TOTAL} and {TOTAL.TAX} would both be prompts in the window and possibly show up in RList reports. Now, I still have all these symbolics and real fields and I want to keep the OI app compatible with the data in the ARev app, so I need to keep the real fields going. In the example cited, {ORDER_TOTAL} in the OI window still works fine, but the write to @RECORD doesn't have any effect. My question is, does anyone have any thoughts on the best way (least work, quickest) to maintain this kind of functionality in an OI window. (In other words, update fields in @RECORD from controls that are not bound to those fields, while the window is running.) Thanks for any thoughts, David ---- === At 10 APR 2002 11:29AM Don Miller - C3 Inc. wrote: === I had exactly the same problem on my first AREV to OI conversion. I used a hidden database bound control which in your case would be stored in field 20. In this way when the symbolics are updated, this hidden control will be updated. You can get the current contnts of this control using a Get_Property call. You can then update other controls, whether hidden or not. It turns out that your old AREV dict calls will still work in reports. You can do the on-the-fly updating either in new dict elements or via logic in the template (on the CHANGED, POSCHANGED, LOSTFOCUS or whatever event. HTH BTW are you going to be in Boston next week?? If so, see you there. Don Miller C3 Inc. ---- === At 10 APR 2002 02:57PM David Kafka wrote: === OK, so I have 3 controls: TAXABLE_AMOUNT is bound to the symbolic {TAXABLE_AMOUNT} TAXABLE_AMOUNT_HIDDEN is bound to the real field {TAXABLE_AMOUNT_REAL} TOTAL_TAX is bound to the symbolic {TOTAL_TAX} {TOTAL_TAX} is @ANS= {TAX_RATE} * {TAXABLE_AMOUNT_HIDDEN} On the CALCULATE even of TAXABLE_AMOUNT I have: Declare Function Set_Property, Get_Property, Send_Event control=CtrlEntId:"_HIDDEN" value=Get_Property(CtrlEntId,'DEFPROP') null=Set_Property(control,'DEFPROP',value); * this works *null=Set_Property(control,'MODIFIED',1); *this does nothing *null=Send_Event(@WINDOW:'.TOTAL_TAX','CHANGED'); *this does nothing RETURN 1 What happens is that when TAXABLE_AMOUNT recalculates, TAXABLE_AMOUNT_HIDDEN properly "recalculates". (So, part of the problem is solved: @RECORD will be OK when I save the form). BUT, the "dependent" control, {TOTAL_TAX} does not recalculate. (in the code above are a couple of my attempts to address that). My question now is: how do I get TOTAL_TAX to recognize it needs to recalculate? (Is there some message I can send to TOTAL_TAX to tell it to recalculate?) Thanks, David (No, I won't be in Boston, but I am thinking real hard about being in Las Vegas.) ---- === At 10 APR 2002 05:29PM David Kafka wrote: === I thought I had tried this: null=Send_Event(@WINDOW:'.TOTAL_TAX','CALCULATE') but I guess not. I think this works. Kind of. I have to hash it through some more. David ---- === At 10 APR 2002 11:15PM Don Miller - C3 Inc. wrote: === David .. I know that works .. I have a number of Daily Calendar blocks which are symbolics. They look like a 7 x 5 matrix with a number and then some formatted text based on the results of a DB table. Since they are interdependent I send a calcute event to each one .. they are on a different page from the DBtable so I don't need to turn off screen update. Otherwise I would. You're gettin' better all the time .. it's only partly mysterious now, right ? Don [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=16FA11A0920E44F188256B97001F72E6|View this thread on the Works forum...]]