I ietv Member Licensed User Longtime User Feb 16, 2012 #1 I get an "Object should first be initialized error" - even if it have the Initialize statement in the line just before the error! I noticed this on my solitaire app also, but I just worked around it. Initialize just doesn't seem to "take" or something. What would cause this type of error? I'm going to see if I can reproduce it with a minimal app and post it.
I get an "Object should first be initialized error" - even if it have the Initialize statement in the line just before the error! I noticed this on my solitaire app also, but I just worked around it. Initialize just doesn't seem to "take" or something. What would cause this type of error? I'm going to see if I can reproduce it with a minimal app and post it.
Erel B4X founder Staff member Licensed User Longtime User Feb 16, 2012 #2 I get an "Object should first be initialized error" - even if it have the Initialize statement in the line just before the error! Click to expand... This cannot occur. You should post the code. Upvote 0
I get an "Object should first be initialized error" - even if it have the Initialize statement in the line just before the error! Click to expand... This cannot occur. You should post the code.
I ietv Member Licensed User Longtime User Feb 16, 2012 #3 Here's the minimal example - modified version of Erel's Tick Tack Toe, using imageviews instead of buttons. Attachments ivttt.zip ivttt.zip 29 KB · Views: 347 Upvote 0
Here's the minimal example - modified version of Erel's Tick Tack Toe, using imageviews instead of buttons.
I ietv Member Licensed User Longtime User Feb 16, 2012 #4 When the program halts, it tells me both that winTag is not initialized (yet it is, in the line before!) and that tV is not initialized (yet it is, 2 lines before!). I suspect that the problem is that I pull an imageview from an array to put into tV. That imageview must be the one that is not initialized. Yet I thought I had initialized it in the Sub Setboard when I placed it in the array. That is where I think I am doing something wrong. Upvote 0
When the program halts, it tells me both that winTag is not initialized (yet it is, in the line before!) and that tV is not initialized (yet it is, 2 lines before!). I suspect that the problem is that I pull an imageview from an array to put into tV. That imageview must be the one that is not initialized. Yet I thought I had initialized it in the Sub Setboard when I placed it in the array. That is where I think I am doing something wrong.
Erel B4X founder Staff member Licensed User Longtime User Feb 16, 2012 #5 Code: Dim winTag As BoxTag Dim tV As ImageView tV.Initialize("Box") tV = Boxes(x,y) winTag.Initialize winTag = tV.Tag 1. It is not the cause of this error, however there is no need to call tv.Initialize as you are assigning an already initialized view to this variable. The same is true for other places in your code. 2. Using the debugger I saw that the error happens when x = 0 and y = 1. Add this line after line 83: Code: Log(tTag.x & " " & tTag.y) You will see that your code doesn't add the boxes correctly. Upvote 0
Code: Dim winTag As BoxTag Dim tV As ImageView tV.Initialize("Box") tV = Boxes(x,y) winTag.Initialize winTag = tV.Tag 1. It is not the cause of this error, however there is no need to call tv.Initialize as you are assigning an already initialized view to this variable. The same is true for other places in your code. 2. Using the debugger I saw that the error happens when x = 0 and y = 1. Add this line after line 83: Code: Log(tTag.x & " " & tTag.y) You will see that your code doesn't add the boxes correctly.