in reply to Linking to Perl from Pascal


In general terms it is probably possible to link a Perl program into Pascal but it probably isn't worth doing it just to get at Spreadsheet::WriteExcel.

If you need to create an Excel file with formatting and formulas then there are easier alternatives such as creating a HTML file or an XML file.

Excel can read HTML tables and it preserves the cell formatting and interpolates any formulas in the text. It will read anything from a very simple <table> structures to its own HTML format.

See Two-dimensional array to "Excel" format for an example.

The XML format used by Excel 2002 and later is called SpreadsheetML and the specification and schemas are available here. The XML format is relatively easy to handle. The Spreadsheet::WriteExcelXML module uses this approach.

As an aside, I wrote Spreadsheet::WriteExcel and as it happens I wrote one of its simpler precursors in Pascal. :-)

--
John.

Replies are listed 'Best First'.
Re: Re: Linking to Perl from Pascal
by Anonymous Monk on May 17, 2004 at 14:20 UTC
    > As an aside, I wrote Spreadsheet::WriteExcel and as it happens I wrote one of its simpler precursors in Pascal. :-)
    Could you show me some code? I was reading all the MS specifications on excel files (BIFF, XML, etc.), and I figured out that the worst work is to write all the headers, data structures and constants. With all this stuff in my hand, it would be easy to port SpreadSheet::WriteExcel back to Pascal.

    I use the freepascal compiler. A unit similar to Spread... would be a useful contribution.

    my email is inpromptu at operamail dot com

      FYI -- you can download his code from CPAN (see search.cpan.org or perl -MCPAN -e 'shell'), without asking for it... it's pretty easy, try it out!
        Yeah, I was looking inside SpreadSheet::WriteExcel . But I mean pascal source code ;) !! Anyway, thanks !!