Welcome, Guest. Please login or register.
September 07, 2010, 08:23:36 am
Home Help Search Login Register
News: Registration disabled until we find cure for spam. In the meantime, feel free to email us your questions.

+  Excelsior Forums
|-+  Other Excelsior Products
| |-+  Native XDS-x86/XDS-C (Moderator: snowman)
| | |-+  incompatible types
« previous next »
Pages: [1] Print
Author Topic: incompatible types  (Read 1512 times)
cmorpad
Newbie
*
Posts: 2


« on: January 13, 2010, 07:07:45 pm »

Hello,

I need help with this issue,

What's this error message caused for? I've tried several times to compile a simple program but have no idea of how to solve it.

* [readnum.mod 12.07 E029]
* incompatible types:
    "INT32"
    "PROCEDURE [Modula] (IOChan.ChanId,VAR INT32)"
  Num $:= ReadInt;

Thank you
Logged
johng
Newbie
*
Posts: 30


« Reply #1 on: January 14, 2010, 02:24:01 am »

You asked about:

Code:
Num $:= ReadInt;

First clue: What is the definition of ReadInt?
Logged
cmorpad
Newbie
*
Posts: 2


« Reply #2 on: January 14, 2010, 02:51:06 am »

Here you are, these are the declarations I included.

      1 MODULE readnum;
      2
      3 FROM InOut IMPORT WriteString,WriteLn,WriteInt;
      4 FROM WholeIO IMPORT ReadInt;
      5 IMPORT SYSTEM;
      6
      7 VAR
      8         Num     : INTEGER;


Thank you
Logged
cfbsoftware
Newbie
*
Posts: 6


WWW
« Reply #3 on: January 14, 2010, 07:00:15 am »

  Num $:= ReadInt;
If you look at the Help file you will see that ReadInt is defined as a procedure which returns a value via a VAR parameter not as a function result. There are two possible uses:

  PROCEDURE ReadInt (cid: IOChan.ChanId; VAR int: INTEGER);
  PROCEDURE ReadInt (VAR int: INTEGER);

Thus you should write something like:

ReadInt(Num);
Logged

Chris Burrows
CFB Software
Armaide v2.0: ARM Oberon-07 Development System
http://www.cfbsoftware.com/armaide
johng
Newbie
*
Posts: 30


« Reply #4 on: February 01, 2010, 07:49:21 am »

Further to Chris' reply, you should always examine the definition of the function in the "DEF" file.  It tells you how to call it and what it returns.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!