DELPHI untyped parameters

DELPHI untyped parameters

There are a lot of Delphi novice confused about the process (function) of untyped parameters, you do not know what type of transfer. In fact, Delph there are many such non-type parameters, such as the commonly used Move process, just put it in front of a Byte array type look on the line.

When used as a string type argument to when no type parameter, should S [1] as an argument (the string type subscripts starting from 1), or with a pointer conversion, such as PChar (s) ^.

If Delphi2009 and above, of type string as a solid pass arguments to no type parameter, be careful not to simply be Length (S) transmitted to the SourceSize, but rather Length (s) * Sizeof (char), because Length ( s) is the length of the string, rather than the actual length of the buffer, and above Delphi2009 the default string is a WideString,

char also equal WideChar, each char occupies 2 bytes.

Of course, a string type transmitted by no type of parameter calculation Base64 encoded Unicode strings, only the parameters passed to the untyped AnsiString type, process or use StrToBase64 (string is automatically converted AnsiString), it may be that you need Base64-encoded .

Guess you like

Origin www.cnblogs.com/hnxxcxg/p/11796675.html