In the meantime, I've managed to solve the "isInIDE()" riddle:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Public Sub main(ByJava args() As String)
Dim myArgs() As String
myArgs = args
Dim i As Integer
Dim s As String
Dim isInIDE As Boolean = (UBound(myArgs) < Lbound(myArgs))
If isInIDE Then
s = "we are in IDE!"
Else
s = "we are outside the IDE!"
End If
s = s & vbCrLf
For i = Lbound(myArgs) To Ubound(myArgs)
s = s & i & ": '" & myArgs(i) & "'" & vbCrLf
Next i
If s = "" Then
s = "(no arguments!)"
End If
MsgBox s
End Sub
|
If a program gets started from within the IDE, the upper bound of "args" evaluates to "-1".
However, a new problem came up:
If you pass a filename with blanks ("a file with blanks.txt") to your program,
the following arguments arrive inside:
args(0): name of the executable
args(1): a
args(2): file
args(3): with
args(4): blanks.txt
Obviously, it would be better to get:
args(0): name of the executable
args(1): a file with blanks.txt
Any ideas?
A1880
p.s.: I've found out that this problem is only present for *.exe files created by Jabaco.
If you start a Jar file via "java -jar my.jar", blank-separated parameters in quotes will be handled properly.