Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: string Date: Tue, 19 Oct 2021 09:09:31 +0200 Lines: 39 Message-ID: References: <29a74e7b-80b2-4dd6-ae3c-8708e0a30403n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net vYk4XUgCE/Yvre6qG4y3HwP60IVBVBX2w3WLVopYhOSDThnTg= Cancel-Lock: sha1:mBfrvYX38U/T/S7n5c0sr9ZwEt8= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:13457 Buon giorno Aurora, the "normal" variable type to use in VO is "string". C/C++, the language in which Windows is written, does not knows that datatype. In these languages (and some more) a string is defined as a sequence of bytes terminated by a byte with the value of 0 (zero). This datatype exists also in VO, and is called "PSZ" - a Pointer to a String terminated with Zero. So, if you have to interface with the Windows API you cannot use a string, but you have to use a PSZ. The function "String2PSZ()" does exactly what it says: a memory part is allocated, and string content is copied there, and terminated with a zero byte. The a pointer to this memory allocation is returned, and this can be passed to the Windows API call. If the function/method ends, the memory is released to the OS. Wolfgang aurora baccio wrote: > good morning. > unknown grammar > My habit in creating string variables is as follows : > local cVariable := "" as string > You always propose me instead of string string2psz. > I would like to know the difference and the usefulness in using one > or the other. If I search in the help I don't understand the > differences. thanks > Aurora Baccio --