Board index » delphi » HELP PLEASE HELP

HELP PLEASE HELP

On Mon, 19 May 1997 10:49:24 +0100, JP <jpears....@compapp.dcu.ie>
wrote:

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:

If I understand the question, how about:

  if CodeEdit.Text = '0106' then

alternatively get the current value directly from the table:

  if MyTable.FieldByName( 'code' ).AsString = '0106' then

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 only shows the properties and events that are in
the PUBLISHED section of the class definition.  To see what else might
be there you can 1) check the on-line help file, 2) use the Class
Browser, 3) look at any paper docs if you have them, or 4) examine the
source code directly (often the ONLY way to see EVERYTHING).

Quote
>Thanks
>John

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

HTH

Stephen Posey
slpo...@concentric.net

 

Re:HELP PLEASE HELP


Quote
JP <jpears....@compapp.dcu.ie> 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?

ANSWER: check out the properties of DBEdit in the help file. In your case, pick
one:
- CodeEdit.Text = '0106'
- CodeEdit.Field.Value = '0106'
- Table1.FieldByName('CODE').AsString = '0106'
- Table1.Fields[<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 shows all accessible at design- and run-time. To
view them all, from the menu, pick View|Browser. And, again, check the
help-file(s).

Have fun.

Jasper

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


|>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....

If (dbedit1.text)='this' then

Other Threads