Re (2): actual-formal parameter conflict 
Author Message
 Re (2): actual-formal parameter conflict


> >> I get error 123 : type of actual parameter is not identical with that of
> >> formal parameter.

> >> I can't figure out why not.

> > You can define a type with

> > TYPE MyArray=ARRAY 50 OF CHAR;

> > and replace all occurences of "ARRAY 50 OF CHAR"
> > with "MyArray", then the types are compatible.

> The reason this works is because Oberon defines name equivalence of types.
> That is, two types must have the same name, not just the same structure to
> be considered the same.  "Anonymous types" like ARRAY 50 OF CHAR,
> declared in a parameter list are, in effect, each given a unique name by the
> compiler as it finds them.  Therefore, no two will ever have the same name.

> > Or you can replace "VAR Name : ARRAY 50 OF CHAR"
> > in your procedure header with "VAR Name : ARRAY OF CHAR".

> The reason this works is because Oberon supports "open array parameters",
> which means that such a parameter, given as an array with no specified
> length will accept an array of any length of the given type.  Within the
> procedure, you can use the built-in function LEN, to learn the length of
> the actual array passed into the function.

Such replies really ADD VALUE.

And so does:

>This problem is explained in Language FAQ,
> http://www.*-*-*.com/
>entry number 4. The same arguments apply to arrays.

The "do XYZ" type of advice is less valuable.
BTW why are most News and emails these days answered ABOVE the
original text ?  Is this a new M$ capability, that I'm missing ?

Chris Glur.

Wed, 26 Feb 2003 23:33:31 GMT  
 [ 1 post ] 

 Relevant Pages 

1. actual-formal parameter conflict

2. Question about matching actual/formal parameters

3. Modelsim and actual/formal assignments

4. Generic Formal With Discrim Used As Actual - How?

5. Formal vs actual signals in port map statement

6. Changing actual arg via intent(in) formal arg in F90

7. Actual parameter

8. converted types as actual in out parameters

9. Function that knows the names of its actual parameters

10. More on expressions as actual parameters

11. How to get number of actual parameters in subroutine

12. Unrolling of actual parameters from list


Powered by phpBB® Forum Software