From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b12bc9a1cc5c6c3 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Spawning a subprocess and communicating with it. Date: 1998/10/08 Message-ID: <6viffv$kqv$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 398977738 References: X-Http-Proxy: 1.0 x5.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Oct 08 13:42:22 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) Date: 1998-10-08T00:00:00+00:00 List-Id: In article , "Condic, Marin D." wrote: > function CP (A : Interfaces.C.Char_Array) return Win32.LPSTR is > function > UC1 > is new > Ada.Unchecked_Conversion ( > Source => System.Address, > Target => Win32.LPSTR); > begin > return UC1 (A (A'First)'Address); > end CP; I doubt this is the problem, but this routine is not guaranteed to do what you want. Remember in Ada you don't know what parameter passing mechanism is being used. It is quite possible that (A'First)'Address is not the same as the address of the first character of A's formal parameter. You are *assuming* the parameter is passed by reference. In the case of a string that's typically a very good assumption, but in Ada 83 it would also have been erronious coding. I'm not sure what it is considered in Ada now, but I wouldn't do it just the same. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own