Page 1 of 1

Migrating code from v4

Posted: Thu Apr 04, 2013 12:29 pm
by jleg
Hello Lars,

As you tell me, i've finally made a new registration. Thanks for your attention.
I'm trying to migrate code from v4 to v5 and i've some difficulties because many changes have been made in the component code. The few indications done in the changes.txt file are not enough to migrate.

Is there an exhaustive document describing how to migrate code from v4 ?

If not, what are the new names of the following v4 units ?
1. XLSFonts4
2. CellFormats4
3. Cell4

How can i replace these statements ?
4. XLS.Sheets.DrawingObjects.Pictures.Clear
by XLS.Sheets.Drawing.BIFFDrawing.Pictures.Clear
or just by XLS.Sheets.Drawing.Clear

5. XLS.formats[0].NumberFormat := 'dd/mm/yyyy';
by XLS.CmdFormat.Number.Format := 'dd/mm/yyyy'; ?

6. What is the corresponding value for "ctNotUsed" in the "TXLSCellType" type ?

7. XLS.Sheets.Columns.AddIfNone(n, 1); ? because AddIfNone is deprecated

8. XLS.FileName := 'file_path';
XLS.Read;
XLS.Sheets[0].LastCol := 4; <= ReadOnly now
XLS.Sheets[0].LastRow := 50000; <= ReadOnly now

thanks for your help.
jleg

Re: Migrating code from v4

Posted: Fri Apr 05, 2013 8:39 am
by larsa
Hello

1. TXc12Font

2. Use XLS.CmdFormat when formatting cells. See sample.

3. Same as above.

4,5 Yes.

6. xctNone

7. AddIfNone is not required anymore. The method is now empty and just kept for backward compability.

8. Use CalcDimensions

Re: Migrating code from v4

Posted: Tue Apr 09, 2013 1:54 pm
by jleg
Hello,

For my 4th question, you answered "Yes" but there were 2 solutions, what is the good one :

4. How to replace

Code: Select all

XLS.Sheets[i].DrawingObjects.Pictures.Clear
by

Code: Select all

XLS.Sheets[i].Drawing.BIFFDrawing.Pictures.Clear
or just by

Code: Select all

XLS.Sheets[i].Drawing.Clear
jleg