Hi Hubertus,
if you occasionally had a short look at the VBTypeClass in the Jabaco-Framework-sources:
http://code.google.com/p/jabacoframework…BTypeClass.java
You maybe noticed that I already began to implement something like the Get-keyword in VB also for Jabaco, last year.
My Idea was to implement something like a binary file access with Get, that could be implemented through Java reflection.
unfortunately I was disturbed because the Framework was not able to compile any more, and moreover I myself ran out of free time.
what you are about to do is impossible due to a completely other reason:
at least concerning the fixed size strings that are possible in VB but not possible in Jabaco until now.
The length descripition of your strings with
As String * X
will be ignored by the Jabaco-Compiler.
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Type ini_Struc
sZeile As String * 2
sName As String * 7
sValue As String * 3
CRLF As String * 2
End Type
Public Sub Command1_Click()
Dim i As ini_Struc
MsgBox Len(i.sZeile)
i.sZeile = "eins zwei drei"
i.sName = "blablablablablablablabla"
i.sValue = "huihuiohuihuihui"
i.CRLF = "cmoncmoncmoncmon"
MsgBox Len(i.sZeile)
MsgBox i.sZeile
End Sub
|
maybe it could be possible to reach the goal with an array of char:
|
Jabaco Source
|
1
2
3
4
5
6
|
Type ini_Struc
sZeile(2-1) As Char
sName(7-1) As Char
sValue(3-1) As Char
CRLF(2-1) As Char
End Type
|
in VB it is possible to assign a String to a byte (char) array and vice versa, but it's not possible in Jabaco until now, you need extra functions for doing this
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
Public Sub Command1_Click()
Dim i As Integer
Dim j As ini_Struc
For i = 0 To Ubound(j.sName)
j.sName(i) = 65 + i
Next
MsgBox CharArrayToString(j.sName)
End Sub
Function CharArrayToString(arr() As Char) As String
Dim s As String
For i = 0 To Ubound(arr)
s = s & Chr(arr(i))
Next
CharArrayToString = s
End Function
|
beware: sZeile(2) is 3 chars long
you may twist and turn it, its all not very beautiful.
regards
OlimilO