Board index » delphi » Newbie-Coming-from-Paradox Question

Newbie-Coming-from-Paradox Question

I am just starting Delphi (2.0) after years of Paradox, and I
am wondering if anyone can point me in the right direction:

 In pdoxwin,  most all of my code goes in ChangeValue() methods,
a lot of it like

  var
    nv string
  endvar
    nv = eventInfo.newValue()

  {Do something with the proposed new value , like:}

   if {some test on nv} then
     disableDefault
     self.action( EdifUndoField )
     return
    endif

    dodefault

    { Do something else }

  endmethod

My question is where (among the many choices) does one routinely
put such code?  -- in the DataSet events or in the DataField control
events, etc.  As with Paradox, you could put this stuff in many places
(like NewValue) but if you choose the wrong one, you may take a
serious hit.  In most situations, I would guess you develop a standard
routine for such stuff.

--
Paul Schopf                           mailto://sch...@gsfc.nasa.gov
Coupled Climate Dynamics Group/971    http://ccdg.gsfc.nasa.gov/~paul
NASA Goddard Space Flight Center              
Greenbelt, MD 20771

 

Re:Newbie-Coming-from-Paradox Question


I'd say you want to use the OnChange event of the individual edit fields.
Unless of course you are doing more elaborate things, and need to step up
a level to the TTable itself. My advice: Just Do It! Start coding. You
will be amazed at how easy it is, (once you get the syntax figured out...)
Brad Miller
Timeoil...@aol.com

Re:Newbie-Coming-from-Paradox Question


Quote
In article <314F2500.794BD...@gsfc.nasa.gov> Paul Schopf <sch...@gsfc.nasa.gov> writes:
>I am just starting Delphi (2.0) after years of Paradox, and I
>am wondering if anyone can point me in the right direction:
> In pdoxwin,  most all of my code goes in ChangeValue() methods,
>a lot of it like

>  var
>    nv string
>  endvar
>    nv = eventInfo.newValue()
>  {Do something with the proposed new value , like:}

>   if {some test on nv} then
>     disableDefault
>     self.action( EdifUndoField )
>     return
>    endif
>    dodefault
>    { Do something else }
>  endmethod
>My question is where (among the many choices) does one routinely
>put such code?  -- in the DataSet events or in the DataField control
>events, etc.  As with Paradox, you could put this stuff in many places
>(like NewValue) but if you choose the wrong one, you may take a
>serious hit.  In most situations, I would guess you develop a standard
>routine for such stuff.

The Delphi event-model is not quite as advanced in this area; not as I would
like it to be.  But you can generally get the job done with a combination of
"onExit" methods (as you've seen, "onChange" gets every keystroke!) and also
data-validation routines at the TDataset level.

It's just not as clean and easy-to-do as Paradox allows; which is unfortunate.

/mr/

Other Threads