Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Command$ issues
#8
I don't really don't want to parse the command line and place the values in an array and recombine the returned array...

What I needed was simply the entire command line such as this:

Code: (Select All)
Rem $Dynamic
DefLng A-Z
x$ = readCommand$
Print x$
End

Function readCommand$
  Declare Library
      Function GetCommandLineA%& ()
  End Declare
  Dim m As _MEM, ms As String * 1000
  a%& = GetCommandLineA
  m = _Mem(a%&, Len(ms))
  ms = _MemGet(m, m.OFFSET, String * 1000)
  If a%& Then
      cmd$ = ms
      eol = InStr(cmd$, Chr$(0))
      If eol Then
        cmd$ = Left$(cmd$, eol - 1)
      End If
      ' parse off program name.
      eol = InStr(2, cmd$, Chr$(34)) + 1
      cmd$ = Mid$(cmd$, eol)
  End If
  _MemFree m
  readCommand$ = cmd$
End Function
Reply


Messages In This Thread
Command$ issues - by eoredson - 04-09-2025, 04:23 AM
RE: Command$ issues - by DSMan195276 - 04-09-2025, 04:53 AM
RE: Command$ issues - by mdijkens - 04-09-2025, 02:53 PM
RE: Command$ issues - by hsiangch_ong - 04-09-2025, 03:15 PM
RE: Command$ issues - by eoredson - 04-09-2025, 09:59 PM
RE: Command$ issues - by eoredson - 04-14-2025, 02:03 AM
RE: Command$ issues - by mdijkens - 04-14-2025, 08:18 AM
RE: Command$ issues - by eoredson - 04-14-2025, 11:12 PM
RE: Command$ issues - by eoredson - 05-02-2025, 01:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help: Issues with the _PRINTSTRING and _INPUTBOX$ functions in QB64. qbfans 2 348 02-13-2026, 06:07 AM
Last Post: qbfans
  Command$(count%) - I can't get a value when using the optional argument "(count%)" Unatic 3 517 08-22-2025, 11:58 AM
Last Post: Unatic
  keyword to get the EXE name and the EXE path instead of parsing Command$(0) ? madscijr 8 1,132 07-22-2025, 08:35 PM
Last Post: hsiangch_ong
  Shell issues eoredson 7 1,316 05-10-2025, 02:59 AM
Last Post: eoredson
  Locate command on the ttf graphical screens Helium5793 5 702 03-09-2025, 05:47 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)