Is there any way to get the command line as string and not as string array?
I need it to get path names correctly.
((I'm on Win32))
I need it to get path names correctly.
((I'm on Win32))
Strict Local cmdline:String = "" Local skip:Int = 0 ' Because we're not interested in the first element For Local i:String = EachIn AppArgs If skip > 0 cmdline:+i+" " Else skip:+1 End If Next Print cmdline
Strict Print CommandLine() Function CommandLine$() Local CmdLine:String For Local e:String = EachIn AppArgs[1..] 'start from the second element of the appargs array CmdLine:+ e +" " 'add each element to the CmdLine string Next Return CmdLine End Function
.gif)
Function CommandLine$ ( ) Local LineLen = GetCmd ( Null , 0 ) + 1 Local LinePtr:Byte Ptr = MemAlloc ( LineLen ) Local Text$ GetCmd LinePtr , LineLen Text = String.FromCString ( LinePtr ) MemFree LinePtr Return Text Extern Function GetCmd ( LinePtr:Byte Ptr , LineLen ) = "_bgetcmd" EndExtern EndFunction