This message was bounced back due to your email problems
Gloria, Jing wrote:
I would appreciate any assistance to the following problem.
The following 2 lines of code result in error during compilation:
Var Testcode: integer; asmname 'testcode';
Error: try_hello.pas:3: parse error before character constant try_hello.pas:5: comma missing after identifier `Asmname' try_hello.pas:5: parse error before `;'
Note: Line 3 is the line with asmname keyword.
I am using: GNU Pascal version 2.95 19990728 (release) (i386-pc-solaris2.7) compiled by GNU C version 2.95.1 19990816 (release).
If I remove the asmname 'testcode' from line 3, then the compilation goes through without any errors.
the syntax of asmname for variables has changed on 2000/04/12, to be more consistent with the syntax for procedures and functions. Old syntax was
Var Testcode: __asmname__ 'testcode' integer;
The new is
Var Testcode: integer; asmname 'testcode'; external;
external is needed if it is imported from elsewhere (usually C), it is not if you want to export from pascal to C;
So use the old syntax if you are in a hurry, but rather upgrade to a recent gpc version (the last alpha is the best).
Maurice