🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4689

Re: Is this a compiler bug?

#4689
From: Dave Seaman
Date: Fri, 03 Mar 1989 15:21
23 lines
1023 bytes
In article <1712@psu-cs.UUCP> bartonr@psu-cs.UUCP (Robert Barton) writes:
>Now the problem: using the statement
>
>  INC(CARDINAL(code), 1);
>
>the compiler gives an error message of "variable expected".  

Correct.  The first argument to INC must be a variable.  The first argument
that you specified is

	CARDINAL(code)

which is not a variable.  It's an expression.  You may want to declare code
as a variant record so that you can access it as any data type you want.
Alternatively, you could use

	code := BITSET(CARDINAL(code)+1)

to do what you want.

-- 
Dave Seaman	  					
ags@j.cc.purdue.edu
Technical Details
Message-ID: <3843@s.cc.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!mentor.cc.purdue.edu!s.cc.purdue.edu!ags
References: <1712@psu-cs.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!mentor.cc.purdue.edu!s.cc.purdue.edu!ags
From: ags@s.cc.purdue.edu (Dave Seaman)
Newsgroups: comp.lang.modula2
Subject: Re: Is this a compiler bug?
Message-ID: <3843@s.cc.purdue.edu>
Date: 3 Mar 89 15:21:50 GMT
References: <1712@psu-cs.UUCP>
Reply-To: ags@s.cc.purdue.edu (Dave Seaman)
Organization: Purdue University
Lines: 23