B4J Question How to pass parameters in cmd to run b4j programs

qqqqw

Member
I want to pass parameters in cmd to run b4j programs,For example, entering "abc.exe c:/1.txt" in CMD

I am new with b4j. I couldn't find any corresponding examples or explanations.How can i do that?

Thank you!
 

peacemaker

Expert
Licensed User
Longtime User
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    If Args.Length > 0 Then
        Try
            If File.Exists(Args(0), "") Then 'don't assume that it is a valid path
                Log("File argument = " & Args(0))
            Else
                Log("File argument = " & Args(0) & " does not exist")
            End If
        Catch
            Log(LastException)
        End Try
    End If
End Sub
 
Upvote 1
Top