E ExcludeReality Active Member Licensed User Feb 22, 2010 #1 My app works fine in debug, and no errors during compile. But when I try to run the app I get an error message saying "Cannot convert an object of the type DBasic.EnhancedControls.CEnhancedLabel to DBasic.IText". I get this error from this line: Code: Control ("Name" & EnemyIndex).Text = Control ("Name" & EnemyIndex).Text +1 EnemyIndex is a variable with the value 5. If I use Code: Name5.Text = Name5.Text +1 it works perfect, and I don't see any difference. Please help
My app works fine in debug, and no errors during compile. But when I try to run the app I get an error message saying "Cannot convert an object of the type DBasic.EnhancedControls.CEnhancedLabel to DBasic.IText". I get this error from this line: Code: Control ("Name" & EnemyIndex).Text = Control ("Name" & EnemyIndex).Text +1 EnemyIndex is a variable with the value 5. If I use Code: Name5.Text = Name5.Text +1 it works perfect, and I don't see any difference. Please help
klaus Expert Licensed User Longtime User Feb 22, 2010 #2 You should add the control type: Example if your control is a TextBox Code: Control ("Name" & EnemyIndex,TextBox).Text = Control ("Name" & EnemyIndex,TextBox).Text +1 Best regards.
You should add the control type: Example if your control is a TextBox Code: Control ("Name" & EnemyIndex,TextBox).Text = Control ("Name" & EnemyIndex,TextBox).Text +1 Best regards.
agraham Expert Licensed User Longtime User Feb 23, 2010 #3 It's a known bug. You don't need the type for intrinsic controls, you need a modified source for CEnhancedLabel. It's here http://www.b4x.com/forum/bug-reports/4488-control-keyword-optimized-compile.html#post25777
It's a known bug. You don't need the type for intrinsic controls, you need a modified source for CEnhancedLabel. It's here http://www.b4x.com/forum/bug-reports/4488-control-keyword-optimized-compile.html#post25777