[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Problem with ReadCard
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Problem with ReadCard |
Date: |
Thu, 11 Mar 2010 10:08:12 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Martin Kalbfuß <address@hidden> writes:
> Hi,
>
> MODULE test;
>
> VAR n : CARDINAL;
>
> BEGIN
>
> ReadCard(n);
> WriteCard(n, 1);
> WriteLn();
>
> END test.
>
> gives for example
>
> 1
> 49
>
> or
>
> 2
> 50
>
> where the first is the repeated, input. What's wrong here?
> Many thanks,
>
> Martin
Hi Martin,
I wonder if you could possibly post the complete code and compiler
options used, as my example code works fine:
MODULE testcard ;
FROM NumberIO IMPORT ReadCard, WriteCard ;
FROM StrIO IMPORT WriteLn ;
VAR
n: CARDINAL;
BEGIN
ReadCard(n);
WriteCard(n, 1);
WriteLn();
END testcard.
:~/GM2$ gm2 -g -c testcard.mod
:~/GM2$ gm2 -g testcard.mod
:~/GM2$ ./a.out
49
49
:~/GM2$ ./a.out
1
1
regards,
Gaius