Java error on int value in Addview

sconlon

Active Member
Licensed User
Longtime User
In the AddView below I want to set the width of each column as defined by the ColumnWidth array.

Dim ColumnWidth(5) As Int
ColumnWidth = Array As Int(130, 130,70,70,70)
For j = 0 To NumberOfColumns - 1
Dim label1 As Label
label1.Initialize("cell")
label1.Text = myitem(j)
label1.Gravity = Alignment
label1.TextSize = FontSize
label1.TextColor = FontColor
label1.Tag = i
pnlItems.AddView(label1, ColumnWidth * j, 0, ColumnWidth(j), RowHeight)
Next

But during compile I get a Java error:

found : int[]
required: double

I thought columnwidth required an int value so why the error.

Thanks for any help.

Sc.
 

klaus

Expert
Licensed User
Longtime User
You are using one time ColumnWidth as a single variable and then as an array.
The Left property of your Labels will not be correct because you multiply a constant value by j,
but your widths are not constant.

Best regards.
 
Last edited:
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
Sorry guys, I have discovered my error which lies in 'ColumnWidth * j' which should of course be something else.

Sc
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…