From: McCrayBill@SpringMind.com   
      
   If you are concerned about changes leading to back and forth   
   triggering, define a Logical variable in the Var section for each   
   field. Let's call it "Flag". Use Flag to avoid repeating an   
   operation.   
      
   If Not Flag Then   
    Flag = True   
    ; Put your changes here   
    Flag = False   
   EndIf   
      
   If you enter this code a second time, the changes aren't made   
   preventing an endless loop.   
      
   Bill   
      
   On Sat, 7 Jun 2008 12:32:42 -0400, "Craig"   
    wrote:   
      
   > Jeff and Fred,   
   > Thanks for your help. I used Jeff's at this point because of the simplicity.   
   > Fred's suggestion, however, may come in handy. With the two fields, if I   
   > change field 2, field 1 changes. Suppose I want the reverse to also happen?   
   > I am concerned that it will go back and forth.   
   > Craig   
   >   
   > "Fred Z" wrote in message   
   > news:c1fcac80-c199-4d9f-afae-e5d0302f3955@t54g2000hsg.googlegroups.com...   
   > > You could use the reason method with the following example taken   
   > > directly from Pdx help.   
   > >   
   > > The following example assumes that a form contains a multi-record   
   > > object bound to the Orders table, and that the Ship_VIA field is a set   
   > > of radio buttons. Assume also that the form is in Edit mode. The   
   > > newValue method for Ship_VIA displays a message indicating why   
   > > newValue was called. When the form opens, the Reason will be   
   > > StartupValue.   
   > >   
   > > ; Ship_VIA::newValue   
   > > method newValue(var eventInfo Event)   
   > > ; show why the newValue method was called   
   > > msgInfo("newValue reason",   
   > > iif(eventInfo.reason() = StartupValue, "StartupValue",   
   > > iif(eventInfo.reason() = FieldValue, "FieldValue", "EditValue")))   
   > > endMethod   
   > >   
   > > When the user scrolls through the table or clicks the nextRec button,   
   > > the Reason will be FieldValue.   
   > >   
   > > ; nextRec::pushButton   
   > > method pushButton(var eventInfo Event)   
   > > action(DataNextRecord) ; this triggers a newValue for Ship_Via   
   > > ; with a Reason constant FieldValue   
   > > endMethod   
   > >   
   > > When the user chooses a different radio button on Ship_VIA or clicks   
   > > the changeRadio button, the Reason will be EditValue.   
   > >   
   > > ; changeRadio::pushButton   
   > > method pushButton(var eventInfo Event)   
   > > ORDERS.Ship_Via = "US Mail" ; this triggers a newValue for Ship_Via   
   > > ; with a Reason of EditValue   
   > > endMethod   
   > >   
   > > Or, if you want to test for the change in a tableframe try   
   > >   
   > > method action(var eventInfo ActionEvent)   
   > > var   
   > > vActionID smallint   
   > > endvar   
   > >   
   > > vActionID=eventinfo.id()   
   > >   
   > > if vActionID=DataPostRecord or vActionID=DataUnlockRecord {plus maybe   
   > > a test to see if the record actually changed}   
   > > then   
   > > ............your code here   
   > > endif   
   > >   
   > > Good luck   
   >   
      
   ----------------------------------------------------------------   
   Reverse parts of the user name and ISP name for my e-address   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|