marcick Well-Known Member Licensed User Longtime User Sep 8, 2022 #1 When in the same module I have multiple identical declaration like for example: Dim Cursor1 as resultset: There are no warnings, but what happen really ? A new memory allocation is involved or the same one is overwritten ? And (before an answer arrive) is the behaviour the same for any type of declaration and any platform (B4i, B4A) ?
When in the same module I have multiple identical declaration like for example: Dim Cursor1 as resultset: There are no warnings, but what happen really ? A new memory allocation is involved or the same one is overwritten ? And (before an answer arrive) is the behaviour the same for any type of declaration and any platform (B4i, B4A) ?
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2022 #2 Is it a local variable or a global variable? Best if you post a simple example code. Upvote 0
marcick Well-Known Member Licensed User Longtime User Sep 8, 2022 #3 Local. Often I declare it in the specific point where I need, for example Dim Cursor1 As ResultSet=con.ExecQuery2("SELECT * ..........: Upvote 0
Local. Often I declare it in the specific point where I need, for example Dim Cursor1 As ResultSet=con.ExecQuery2("SELECT * ..........:
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2022 #4 Please use [code]code here...[/code] tags when posting code. The allocation happens in the call to con.ExecQuery2. It returns a ResultSet object. It doesn't matter whether you write Dim multiple times or not. Don't worry about such issues. They will never have any impact on the performance. Upvote 0
Please use [code]code here...[/code] tags when posting code. The allocation happens in the call to con.ExecQuery2. It returns a ResultSet object. It doesn't matter whether you write Dim multiple times or not. Don't worry about such issues. They will never have any impact on the performance.