Hallo peter,
Am 15.10.96 um 19:34 sagtest Du zum Thema "Re: proto-FAQ -- reactions please!":
function GetEnv(name : PChar): PChar; C; function GetEnv(name : PChar): PChar; external;
You can and should use
Function GetEnv ( Name: __CString__ ): pChar; C;
instead. With this declaration, you can pass a String schema as an actual parameter. However, the return value must be a pChar. (Not absolutely sure about this ... maybe a formal pChar parameter can also have an actual String schema parameter ...)
Would be a nice thing - but it dos'nt work ... If you call this GetEnv you get an error: "incompatible type for argument 1 of 'GetEnv'"
The other way : function GetEnv(name : PChar): PChar; C;
This also not work with the string-conversion from the faq ;-( Every time I get a empty string from "GetEnv". (I tried it under DOS.)
___, ((__ o ,____)) V E N I
Moment please ... I think I've found a solution:
Function GetEnv (var Name: __CString__ ): pChar; C; ^^^ You get a warning about incompatible pointers, but it works ... Please remove this stupid warning and I'm happy. Yes, I know - I can use {$W-}, but it's not so elegant ;-)