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

How Float to Widestring?

Status
Not open for further replies.

binbyte

Technical User
Nov 24, 2004
11
AR
I have a problem when trying to write in Delphi a program that I wrote a time ago in Visual Basic. I, instead of using Stringrid, want to use Msflexgrid, for which I concerned it using import ActiveX from Delphi but the problem is that when trying to put the values of an array in the grid, for example:

for i := 1 to nRows-1 do
Begin
For j := 1 to nCols -1 do
Begin
temp := FloatToStr(A[i, j ]);
FlexGrid.textmatrix[j, i] := temp;
end;
end;

I got an error message because the property textmatrix has format widestring and not string like property Cells de Stringrid. If somebody has had this problem before or if somebody has idea of like solving it and to give some aid me.

Thanks
 
That's wierd, to the best of my knowledge the compiler adds code to convert between string types as neccessary automatically. You could try declaring temp as a WideString to force it to do the conversion (if you ahevn't already).
 
try this :

Code:
...
FlexGrid.textmatrix[j, i] := WideString(temp); 
...

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top