コマンドラインを取得するにはGetCommandLine()を使う。
コマンドラインのポインタを得るだけなので、内容を変更するときはバッファにコピーしとくべきだと思う。
コマンドは分割されておらず、"argv[0] argv[1] ..."な感じ。自力で分割する。


#N88BASIC

'コマンドの和夫返す
Function GetArgc(cmd As *Byte) As Long
Dim state1 As Long'コマンド内かどうか
Dim state2 As Long'クオート内かどうか
Dim count As Long'コマンドの数
Dim n As Long
state1 = FALSE
state2 = FALSE
count = 0
n=0
While cmd[n]<> 0
If state1=FALSE And cmd[n]<>Asc(" ") Then
state1 = TRUE
count++
If cmd[n]=Asc(Ex"\q") Then
state2 = TRUE
End If
Else If state1 = TRUE And state2 = FALSE And cmd[n]=Asc(" ") Then
state1 = FALSE
Else If state2 = TRUE And cmd[n]=Asc(Ex"\q") Then
state2 = FALSE
End If
n++
Wend
GetArgc = count
End Function

'コマンドの文字返す
Function GetArgv(cmd As *Byte, argc As Long) As *Byte
Dim state1 As Long'コマンド内かどうか
Dim state2 As Long'クオート内かどうか
Dim count As Long'コマンドの数
Dim p1 As *Byte, p2 As *Byte
Dim n As Long
state1 = FALSE
state2 = FALSE
count = 0
n=0
While cmd[n]<> 0
If state1=FALSE And cmd[n]<>Asc(" ") Then
state1 = TRUE
If count = argc Then
p1 = VarPtr(cmd[n])
End If
count++
If cmd[n]=Asc(Ex"\q") Then
state2 = TRUE
End If
Else If state1 = TRUE And state2 = FALSE And cmd[n]=Asc(" ") Then
state1 = FALSE
If p1<> NULL Then
p2 = VarPtr(cmd[n])
Exit While
End If
Else If state2 = TRUE And cmd[n]=Asc(Ex"\q") Then
state2 = FALSE
End If
n++
Wend
If state1 = TRUE Then
state1 = FALSE
p2 = VarPtr(cmd[n])
If state2 = TRUE Then state2 = FALSE
End If
GetArgv = calloc(p2-p1+1)
memcpy(GetArgv, p1,p2-p1)
End Function

Dim cmd As *Byte
Dim argc As Long
Dim argv As *Byte
cmd = malloc(lstrlen(GetCommandLine()))
lstrcpy(cmd, GetCommandLine())
argc = GetArgc(cmd)
Do
argc--
argv = GetArgv(cmd,argc)
Print MakeStr(argv)
free(argv)
Loop While argc
free(cmd)