Oberon Community Platform Forum
December 12, 2019, 09:56:39 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: OP2 => err 22 ")" missing  (Read 4039 times)
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« on: August 17, 2010, 05:34:39 PM »

the code is from A2 Trace.Mod:

Code:
(** AUTHOR "fn"; PURPOSE "Low-level trace output based on KernelLog"; *)

MODULE Trace;

IMPORT SYSTEM;

TYPE
CharProc*= PROCEDURE (c:CHAR);
VAR
Char*: CharProc;
Color*: PROCEDURE (c: SHORTINT);

(** Send the specified characters to the trace output (cf. Streams.Sender). *)
PROCEDURE Send* (CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);
                ^
                |_________   err 22  ")" missing

 Huh
Logged

duke
cfbsoftware
Full Member
***
Posts: 107


WWW
« Reply #1 on: August 18, 2010, 12:58:36 AM »

Code:
PROCEDURE Send* (CONST buf: ARRAY OF CHAR; ofs, len: LONGINT; propagate: BOOLEAN; VAR res: LONGINT);

The CONST modifier which indicates that a parameter is 'read-only' is a language feature that is not part of Oberon or Oberon-2. It is part of the Oberon-07 language specification and presumably is implemented as an extension in the compiler that this code was originally written for. Replace 'CONST buf' with 'VAR buf' for best performance or just 'buf' if you want to be sure it will not be modified by Send.
Logged

Chris Burrows
Astrobe v7.0 (Feb 2019): Oberon for ARM Cortex-M3, M4 and M7 Microcontrollers
http://www.astrobe.com
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #2 on: August 18, 2010, 02:44:31 PM »

Excellent! Thank you...

Is it fair to assume that the Oberon and Oberon-2 compilers "default" to err 22 if no other error message is apropos?
Logged

duke
cfbsoftware
Full Member
***
Posts: 107


WWW
« Reply #3 on: August 19, 2010, 02:04:50 AM »

Excellent! Thank you...

Is it fair to assume that the Oberon and Oberon-2 compilers "default" to err 22 if no other error message is apropos?

No - that is not fair Wink

What happened here is that the compiler detected the CONST keyword earlier than expected. It would have been valid if your code had been, for example:

PROCEDURE Send*(); CONST x = 1;

So in this case the best guess it could come up with is that you forgot the ')'.
« Last Edit: August 19, 2010, 02:06:45 AM by cfbsoftware » Logged

Chris Burrows
Astrobe v7.0 (Feb 2019): Oberon for ARM Cortex-M3, M4 and M7 Microcontrollers
http://www.astrobe.com
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #4 on: August 19, 2010, 06:01:35 AM »

Thanks for clearing that up.
Logged

duke
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!