Re: Why always open array as parameter?

From: [at]} <Gérard>
Date: Tue, 11 Dec 2001 17:05:41 +0100

> All,
>
> Why do I get an incompatible assignment on Do(f) when compiling the
> following?
> It's solved by making fid an open array. But why can't one pass fixed
arrays
> of the same size? Seems odd.

Hello Bart,

Yes, it looks odd, but it corresponds to the language definition. The best
solution, I think, is to define a new type, like this:

MODULE BarbB;

IMPORT StdLog;

TYPE
array= ARRAY 8 OF CHAR;

VAR
f : array;

(*
--------------------------------------------------------------------------
*)
PROCEDURE Do(fid : array);
BEGIN
StdLog.String('SOMETHING'); StdLog.Ln;
END Do;

(*
--------------------------------------------------------------------------
*)
PROCEDURE Test*;
BEGIN
f := "123";
Do(f); (* HERE *)

END Test;

(*
--------------------------------------------------------------------------
*)

END BarbB.

BarbB.Test;

Regards.

Gérard

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

d
Received on Tue Dec 11 2001 - 16:05:41 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:46 UTC