GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #12812

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: Eike Lange
Subject: External CString
Date: 28 Oct 2005, 16:43:36

Hi Folks!

In a C wrapper file, I have the declaration

/* xmlc.c */
const char* _c_CXML_DEFAULT_VERSION = XML_DEFAULT_VERSION;

Now, I would like to use it in pascal.

{ xml.pas, Unit }
unit XML;

interface

var
C_HELPER_XML_DEFAULT_VERSION: CString; external name
       '_c_CXML_DEFAULT_VERSION'; attribute (const);

XML_DEFAULT_VERSION: TString = 
    CString2String (C_HELPER_XML_DEFAULT_VERSION);

implementation
{$L xmlc.c}
end.


Using this unit results in an error:
"cannot evaluate this expression from a global declaration"
"Error initial value is of wrong type".

How can I use my string constant in GPC?

Eike

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Replies

Author Subject Date
Frank Heckenbach External CString 28 Oct 2005, 17:03:34
Eike Lange External CString 31 Oct 2005, 17:47:10

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).