RE: RECORD vs POINTER TO RECORD

From: [at]} <johansson{>
Date: Tue, 22 Aug 2000 15:52:56 +0200

Hi Mary,

We don't fully understand what you would like to do. However, the ObxLines
example might be helpful to you. In this example there is a model which
contains a linked list of lines. The definition of these datatypes looks
like this:

Line = POINTER TO RECORD
        next: Line;
        x0, y0, x1, y1: INTEGER
END;

Model = POINTER TO RECORD (Models.Model)
        lines: Line
END;

And internalize for this model is defined this way:

PROCEDURE (m: Model) Internalize (VAR rd: Stores.Reader);

For pointer types, "VAR" is not needed in method definitions. It's the
contets of the model that will be changed, not the model pointer.

If this doesn't help to solve your problem, then maybe you can describe your
problem more in detail or send us your program.

Regards,
Bengt, Oberon microsystems inc.


> -----Original Message-----
> From: Mary Kynn [mailto:m.kynn{([at]})nowhere.xy
> Sent: Dienstag, 22. August 2000 06:27
> To: blackbox{([at]})nowhere.xy
> Subject: RECORD vs POINTER TO RECORD
>
>
> When I define
>
> Model = RECORD (Models.Model)
> etc
>
> instead of
>
> Model = POINTER TO RECORD (Models.Model)
> etc
>
> and then try to define the internalize/externalize etc
> PROCEDURE (VAR m: Model) Internalize- (VAR rd: Stores.Reader)X;
>
> I get the error message (at X) that the parameter doesn't match (there
> may be other errors as well in defining the Model this way)
>
> I have tried to define the model as a record because the model contains
> linked lists (which I want to alter within methods) and cannot call a
> pointer by reference in the receiver of methods.
>
> Can anyone help me with this?
>
> regards,
> Mary Kynn
>
> School of Mathematical Sciences
> Queensland University of Technology
> Australia
>
> --------------------------------------------
>
> 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 Aug 22 2000 - 13:52:56 UTC

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