Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!DE0HRZ1A.BITNET!HPA111 From: HPA111@DE0HRZ1A.BITNET ("Michael Drechsler +49 343062", 0201) Newsgroups: comp.lang.modula2 Subject: CHAR-String compatibility Message-ID: Date: 22 Apr 88 08:43:27 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Info-Modula2 Distribution List Organization: The Internet Lines: 26 Hello, Given: PROCEDURE P(S : ARRAY OF CHAR); If I try to call this proc with a CHAR type argument, the compiler I'm using (M2/CMS for IBMs running VM/CMS; based on a ETH-compiler(?)) flags a "type incompatibility" error. I think, that a single char should be compatible because it can be seen as an ARRAY [0..0] OF CHAR. I have nothing found about that problem in Wirth's book PIM2 ed.3 (german version). Does anyone of you knows more about that problem? Perhaps in the english version of the above book? But if a CHAR as ARRAY [0..0] OF CHAR is compatible to a formal parameter ARRAY OF CHAR, then the following should also be valid: calling a PROCEDURE pp(AnyVar : ARRAY OF AnyType); with a single variable of type "AnyType", because the single variable in the procedure call can also be seen as an ARRAY [0..0] OF AnyType. Is this correct? Thanks for your help, Michael