Board index » delphi » HELP PLEASE HELP

HELP PLEASE HELP

De : JP <jpears....@compapp.dcu.ie>

Groupes de discussion : comp.lang.pascal.delphi.misc

Date : lundi 19 mai 1997 11:49

Objet : HELP PLEASE HELP

Quote
>How do I use the actual data contents of a control in a program?

>eg.  A form with a DBEdit linked to 'code' field.  I want to say
>something like:
>if (CodeEdit.datafield.VALUE) = '0106' then......

>I just want to be able to use the contents of various data controls as
>values in imperative code...can it be done?

>ANSWER:

try :

if (CodeEdit.field.AsInteger) = 0106

or :

if (CodeEdit.field.AsString) = '0106'

Quote

>Also is there a way of viewing ALL the possible methds and events of an
>object, or does the object inspector show them ALL?

>ANSWER:

The object inspector does NOT show any of the methods of the objects (in
fact, it doesn't even show objects stuff in general, but components'). All
the events are displayed, as far as I know delphi.
 

Re:HELP PLEASE HELP


How do I use the actual data contents of a control in a program?

eg.  A form with a DBEdit linked to 'code' field.  I want to say
something like:
if (CodeEdit.datafield.VALUE) = '0106' then......

I just want to be able to use the contents of various data controls as
values in imperative code...can it be done?

ANSWER:

Also is there a way of viewing ALL the possible methds and events of an
object, or does the object inspector show them ALL?

ANSWER:

Thanks
John

PS PLEASE post AND E-MAIL reply....

Re:HELP PLEASE HELP


Quote
JP wrote:

> How do I use the actual data contents of a control in a program?

> eg.  A form with a DBEdit linked to 'code' field.  I want to say
> something like:
> if (CodeEdit.datafield.VALUE) = '0106' then......

> I just want to be able to use the contents of various data controls as
> values in imperative code...can it be done?
> Hi,

 At first you should change the code
 if (CodeEdit.datafield.VALUE) = '0106' to
 if (CodeFIeld.DataSource.DataSet[CodeEdit.DataField] = '0106'...
 you will get the actual content of record. (if you moved from this
control after changes.)
 you can also do like this if CodeField.Text = '0106'it will
be current content of edit control, if you changed them and not updated
the record it will be different from actual value in record.
******************************************
  Baltic Advanced  Technologies
  Solutions for software developers
  http://www.batsoft.com
  OverPLAY - build your applications scalable
  OverDIG for InterBase - work with InterBase faster,
  OptStyle -boost your typing productivity
  and more...
******************************************

Other Threads