Last active
February 12, 2026 09:22
-
-
Save Linda-chan/b5d71f338852a5039053848bc62e833b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "windows.bi" | |
| #include "win\shellapi.bi" | |
| '==================================================================== | |
| Declare Sub Main() | |
| Declare Sub MyPrint(ByVal Text As String) | |
| Declare Function MyCommand() As String | |
| '==================================================================== | |
| Main | |
| '==================================================================== | |
| Public Sub Main() | |
| Print "/" & *Cast(ZString Ptr, GetCommandLine()) & "/" | |
| Print "/" & MyCommand() & "/" | |
| End Sub | |
| '==================================================================== | |
| Private Function MyCommand() As String | |
| Dim lpCmdLine As ZString Ptr | |
| Dim CmdLine As String | |
| Dim RC As Integer | |
| lpCmdLine = GetCommandLine() | |
| If Len(*lpCmdLine) = 0 Then Return "" | |
| CmdLine = *lpCmdLine | |
| CmdLine = LTrim(CmdLine, Any !" \t\r\n") | |
| If Left(CmdLine, 1) = """" Then | |
| RC = InStr(2, CmdLine, """") | |
| If RC = 0 Then Return "" | |
| RC = RC + 2 | |
| Else | |
| RC = InStr(CmdLine, " ") | |
| If RC = 0 Then Return "" | |
| RC = RC + 1 | |
| End If | |
| Return Mid(CmdLine, RC) | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment