See also:
DO declare
LOCAL nAddress, cBuffer, nBufsize
nAddress = GetCommandLine() && returns an address in memory
nBufsize = GlobalSize(nAddress)
* allocating and filling a buffer
IF nBufsize <> 0
cBuffer = Repli(Chr(0), nBufsize)
= CopyMemory(@cBuffer, nAddress, nBufsize)
ELSE
* a possibility in Win98/Me
cBuffer = Repli(Chr(0), 512)
= CopyMemory(@cBuffer, nAddress, 512)
cBuffer = SUBSTR(cBuffer, 1, AT(Chr(0)+Chr(0),cBuffer)+1)
ENDIF
cBuffer = STRTRAN(cBuffer, CHR(0), "")
? "Command line: [" + cBuffer + "]"
PROCEDURE declare
DECLARE INTEGER GetCommandLine IN kernel32
DECLARE INTEGER GlobalSize IN kernel32;
INTEGER hMem
DECLARE RtlMoveMemory IN kernel32;
As CopyMemory;
STRING @Destination, INTEGER Source,;
INTEGER nLength