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.
Thanks in advance for any assistance.
This part of the syntax was changed recently. What you describe is the new syntax, but your compiler version requires the old syntax like this:
Var Testcode: __asmname__ 'testcode' integer; Testcode: integer;
Note that's a non-external variable with a specified asmname. If you mean an external variable, the old syntax is:
Var Testcode: __asmname__ 'testcode' integer;
and the new one:
Var Testcode: integer; external; asmname 'testcode';
So, use the old syntax or upgrade GPC (if you're doing such things a lot, you might want to upgrade now, since you'll probably do it sometime, anyway, and then you'd habve to change everything).
Frank
PS: Please turn off HTML!
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html