s0ak 0 Posted April 26, 2007 hello, my code is: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_a=lbCurSel 500; _placea=switch (_a) do {case 0: {"0"}; case 1: {"1"}; case 2: {"1"}; case 3: {"1"}; case 4: {"1"}; case 5: {"1"}; case 6: {"1"}; case 7: {"1"}; case 8: {"2"}; case 9: {"2"};} _lima=_placea+2; When I does that, it posts me an error (generic Error in an expression), I does not see at all or its comes, whereas when I remove the line _lima=… and that I replace it by ctrlSetText [206, _lima]; its value (0 or 1 or 2) posts me well. Have an idea of the error? Thank you Share this post Link to post Share on other sites
t_d 47 Posted April 26, 2007 You cannot add a number to a string. Either you add a number to a number or you add a string to a string. So try this. I hope it is what you want. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_a=lbCurSel 500; _placea = "1"; if(_a == 0)then{_placea = "0"}; if(_a in [8,9])then{_placea = "2"}; _lima=_placea+"2"; Share this post Link to post Share on other sites