This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Error: must operate on two scalar (not array) subexpressions
- From: Hassan Aurag <aurag at cae dot com>
- To: Andrew Stone <astone at brightlane dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 13 May 2002 14:39:57 -0400
- Subject: Re: Error: must operate on two scalar (not array) subexpressions
- References: <OKELKEGKKOINCPCMEJFIKENHCLAA.astone@brightlane.com>
Hi,
I guess UNTYPE is an integer*4, right?
In this case, there is no way you can compare it to a character*4,
unless you are on some very old machines with some very proprietary
compilers ;-)
The solution is:
integer*4 what1
character*4 what2
equivalence (what1, what2)
what2 = 'XX '
if (untype .eq. what1) .....
On Mon, 2002-05-13 at 14:30, Andrew Stone wrote:
> Hello all,
>
> First off, I hope I'm in the right place. I'm working on a project
> to put a DOS based system on the web. This system was written in
> FORTRAN-77 (not by me) and compiled with Salford's FTN77. I'm trying
> to compile this source code using g77 and get the following error:
>
> CALC401K.FOR:194:
> IF(UNTYPE.EQ.'XX ') GOTO 171
> 1 2
> Equality operator at (1) must operate on two scalar (not array)
> subexpressions, two function invocations returning arithmetic or character
> scalars, or a combination of both -- but the subexpression at (2) is an
> array
>
> UNTYPE is Declared as:
>
> COMMON/UNTYPE/UNTYPE
>
>
> Any help would be greatly appreciated, I've tried different compiler
> options and have not had any luck.
>
> thanks in advance,
> andy
>
>
> Andrew Stone
> XML Architect/Developer
> BrightLane, a TeamStaff Inc. Company
> Office: 678-385-2823
>
> Andrew Stone
> XML Architect/Developer
> BrightLane, a TeamStaff Inc. Company
> Office: 678-385-2823