M micro Well-Known Member Licensed User Longtime User Sep 21, 2017 #1 Hi in a resumable sub i have this code Code: Copy Sub CloseWork(start as int) Dim row() as String Dim i as int For i = start To Main.TableView1.Items.Size - 1 Main.TableView1.SelectedRow = i row = Main.TableView1.SelectedRowValues 'here the error is logged Error: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String; Because row() are string and TableView Row are object but I remember that in earlier versions of B4j did not happen (or do I remember well?) In debug mode work fine only in release mode not work.
Hi in a resumable sub i have this code Code: Copy Sub CloseWork(start as int) Dim row() as String Dim i as int For i = start To Main.TableView1.Items.Size - 1 Main.TableView1.SelectedRow = i row = Main.TableView1.SelectedRowValues 'here the error is logged Error: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String; Because row() are string and TableView Row are object but I remember that in earlier versions of B4j did not happen (or do I remember well?) In debug mode work fine only in release mode not work.
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2017 #2 Your code is wrong. It is not related to the sub being a resumable sub. TableView.SelectedRowValues returns an array of objects. You should change your code to: Code: Copy Dim row() As Object Note that you don't need to change the selected row at all: Code: Copy row = Main.TableView.Items.Get(i) Upvote 0
Your code is wrong. It is not related to the sub being a resumable sub. TableView.SelectedRowValues returns an array of objects. You should change your code to: Code: Copy Dim row() As Object Note that you don't need to change the selected row at all: Code: Copy row = Main.TableView.Items.Get(i)
M micro Well-Known Member Licensed User Longtime User Sep 22, 2017 #3 Erel said: Note that you don't need to change the selected row at all: Click to expand... sure, I saw I hade solved in this way Code: Copy Dim row() As Object row = Main.TableView.Items.Get(i) Dim s As String = row(0) ...... Thanks Upvote 0
Erel said: Note that you don't need to change the selected row at all: Click to expand... sure, I saw I hade solved in this way Code: Copy Dim row() As Object row = Main.TableView.Items.Get(i) Dim s As String = row(0) ...... Thanks