Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can one display contents of variables? 2

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I have the following which I need to display in a TDBTextBox
or perhaps even using the Caption property in a Label.

var
Details1 : Variant;
Details2 : Integer;
Details3 : string;

Can some guru out there give me an idea as to how to do this please?

Thanks in advance.

TERRY
 
If you want to use a label you have to convert the integer to a string.
something like:

mylabel.caption := IntToStr(Details2)

The variant type, don't know how to do it.

Steven van Els
SAvanEls@cq-link.sr
 
What is a TDBTextBox ? If you mean TDBText then the following will work:
Code:
  DBText1.Caption := Details1;             // Variant
  DBText1.Caption := IntToStr(Details2);   // Integer
  DBText1.Caption := Details3;             // String
Similar code will work for Caption property in a TLabel.
Code:
  Label1.Caption := Details1;              // Variant
  Label1.Caption := IntToStr(Details2);    // Integer
  Label1.Caption := Details3;              // String


Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top