- ReadStore

From: [at]} <Gérard>
Date: Sat, 02 Sep 2006 22:40:50 +0200

----boundary-LibPST-iamunique-1382875695_-_-
Content-type: text/plain

Douglas G. Danforth a écrit :
> Folks,
> Subject: Stores
>
> I am getting an error I can not interpret.
> I believe I have done all of this before but
> can not remember what I did then.
>
> Here is a chunk of code for which I get the warning:
> "type is not identical with that of formal VAR-, IN- or OUT -parameter"
>
> Notice that there is no complaint in writing the store only in reading it.
>
> -Doug
Hello Doug,

You must get parameter compatibility between Bits and Stores.Store when
calling r.ReadStore(bits).

An actual parameter a of type Ta is parameter compatible with a formal
parameter f of type Tf if
1. Tf and Ta are equal types, or
2. f is a value parameter and Ta is assignment compatible with Tf, or
3. f is an IN or VAR parameter and Tf and Ta are record types and Ta is
an extension of Tf.

In your case, you have:
   
    PROCEDURE (VAR rd: Reader) ReadStore (OUT x: Store)

so f (or x here) is not a value parameter and not an IN or VAR
parameter. So only case 1 applies, and is not verified by your code. You
should define:

    VAR s: Stores.Store;

and write:
   
    r.ReadStore(s); bits := s(Bits);

Cheers.

Gérard

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-1382875695_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBEb3VnbGFzI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JhbWV0ZXIgYW5kIFRhIGlzIGFzc2lnbm1lbnQgY29t
cGF0aWJsZSB3aXRoIFRmLCBvclxwYXINCjMuICBmIGlzIGFuIElOIG9yIFZBUiBwYXJhbWV0ZXIg
YW5kIFRmIGFuZCBUYSBhcmUgcmVjb3JkIHR5cGVzIGFuZCBUYSBpcyBccGFyDQphbiBleHRlbnNp
b24gb2YgVGYuXHBhcg0KXHBhcg0KSW4geW91ciBjYXNlLCB5b3UgaGF2ZTpccGFyDQogICBccGFy
DQogICAgUFJPQ0VEVVJFIChWQVIgcmQ6IFJlYWRlcikgUmVhZFN0b3JlIChPVVQgeDogU3RvcmUp
XHBhcg0KXHBhcg0Kc28gZiAob3IgeCBoZXJlKSBpcyBub3QgYSB2YWx1ZSBwYXJhbWV0ZXIgYW5k
IG5vdCBhbiBJTiBvciBWQVIgXHBhcg0KcGFyYW1ldGVyLiBTbyBvbmx5IGNhc2UgMSBhcHBsaWVz
LCBhbmQgaXMgbm90IHZlcmlmaWVkIGJ5IHlvdXIgY29kZS4gWW91IFxwYXINCnNob3VsZCBkZWZp
bmU6XHBhcg0KXHBhcg0KICAgIFZBUiBzOiBTdG9yZXMuU3RvcmU7XHBhcg0KXHBhcg0KYW5kIHdy
aXRlOlxwYXINCiAgIFxwYXINCiAgICByLlJlYWRTdG9yZShzKTsgYml0cyA6PSBzKEJpdHMpO1xw

YXINClxwYXINCkNoZWVycy5ccGFyDQpccGFyDQpHXCdlOXJhcmRccGFyDQpccGFyDQotLS0gQmxh
Y2tCb3hccGFyDQotLS0gc2VuZCBzdWJqZWN0IEhFTFAgb3IgVU5TVUJTQ1JJQkUgdG8gYmxhY2ti
b3hAb2Jlcm9uLmNofX0A4xNh2AAAABoAAA=


----boundary-LibPST-iamunique-1382875695_-_---
Received on Sat Sep 02 2006 - 22:40:50 UTC

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