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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Twidestring 1

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I have a component property that has a twidestring class.
If i write mycomponent.footer := 'Test'; i get an error saying that there's incompatibility between twidestrings and strings.

I have been searching an an answer but cannot find anything.

How do i need to write the text portion of the footer?

Thanks.
P
 
Is it possible for you to post MyComponent's interface section, specifically the declaration of MyComponent, and what footer is declared as

Assuming something like:

Code:
interface

uses xx, yy, zz;

type
   TWideString = XXXX;//What is this declared as?

   MyComponent = class(TComponent)
      ...
      footer: TWideString;
      ...
   end;

if XXX resolves to 'WideString' then you can simply typecast your value to a TWideString (Delphi/Pascal is a "Strongly Typed Language" so even though footer is a TWideString which is a WideString they are not assignment compatible with other WideStrings because it is declared as a separate 'type' - you can avoid this by simply declaring footer as WideString and drop the reference to TWideString), or as stated do the type casting:

Code:
mycomponent.footer := TWideString('Test');

if the declaration is more complex, then posting the code will tell us how to assign a value to footer.
 
I am going to contact the developer. I am trying the EMS VLC export component. I am trying to export my database to an excel spreadsheet and inside the component, you can add a footer and header property. When i click on the property and add text, it does not stick. It keeps disappearing. So i tried using code instead but i run into the twidestring/String conflict.

Thanks for your input..
Appreciate it.
P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top