RE: Why always open array as parameter?

From: Wijck, Bart van <"Wijck,>
Date: Tue, 11 Dec 2001 17:51:03 +0100

Thanks to all who basically came up with the same suggestion, namely to use
an explicitely named TYPE. As I defined it originally it appeared (!) they
had the same type (ARRAY 8 OF CHAR) but that's the structure not a named (!)
type. I should have known (deep sigh).

Regards Bart

-----Original Message-----
From: Gérard Meunier [mailto:gmeunier{([at]})nowhere.xy
Sent: Tuesday, December 11, 2001 5:06 PM
To: Wijck, Bart van; blackbox{([at]})nowhere.xy
Subject: Re: Why always open array as parameter?


> 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
--------------------------------------------

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
Received on Tue Dec 11 2001 - 16:51:03 UTC

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