LPARAMETERS P01, P02, P03, P04, P05, P06, P07, P08, P09, P10 #DEFINE CR_LF CHR(13) + CHR(10) LOCAL lsBuffer, lnAddress, lnBufsize, lnPcount lnPcount = PCOUNT() IF lnPcount <= 1 && Fox can't see them... but they are there :) * GET THE ENTIRE COMMAND LINE * Code adapted from http://www.news2news.com/vfp/?example=51&function=78 * Given by Mario Lopez on Spanish FoxPro Google Group - 23/12/2013 * https://groups.google.com/d/msg/publicesvfoxpro/llS-kTNrG9M/LA4D3fd152IJ *----------------------------------------------------------------------------- DECLARE INTEGER GetCommandLine IN kernel32 DECLARE INTEGER GlobalSize IN kernel32 INTEGER HMEM DECLARE RtlMoveMemory IN kernel32 AS CopyMemory STRING @Destination, INTEGER SOURCE, INTEGER nLength lnAddress = GetCommandLine() && returns an address in memory lnBufsize = GlobalSize(lnAddress) * allocating and filling a buffer IF lnBufsize <> 0 lsBuffer = REPLICATE(CHR(0), lnBufsize) = CopyMemory(@lsBuffer, lnAddress, lnBufsize) ENDIF lsBuffer = CHRTRAN(lsBuffer, CHR(0)+'"', " ") FOR I = 1 TO OCCURS("'", lsBuffer) / 2 STORE STREXTRACT(lsBuffer, "'", "'", I*2-1, 0) TO ('P' + TRANSFORM(I,'@L ##')) lnPcount = lnPcount + 1 ENDFOR RELEASE lsBuffer, lnAddress, lnBufsize CLEAR DLLS 'GetCommandLine', 'GlobalSize', 'RtlMoveMemory' ENDIF.
Set WSHShell = WScript.CreateObject("WScript.Shell") For I = 1 TO WScript.Arguments.Count cParam = WScript.Arguments(x) Next.