Homer Johnston 0 Posted July 18, 2008 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">test = [1,2,3,4,5,6]; for "_i" from 0 to 3 do { test select 1 = [10]; }; Can anyone tell me why this generates a "Type: String, expected: Code" error? It seems to go away if I get rid of the select command (ie test = [10]; ) Thanks! Share this post Link to post Share on other sites
The_Captain 0 Posted July 18, 2008 That means something didn't work properly within your loop. It could be one of two things: 1) looks like you're trying to set the value of the first element to 10. However, you need to use the set command to set an array element. http://community.bistudio.com/wiki/set 2) You might need to put parentheses around "test select 1". Depending on the order of evaluation, you might end up performing a command on the number, not the thing the array returned. Best to put those in parens. Share this post Link to post Share on other sites
Homer Johnston 0 Posted July 18, 2008 Didn't know about the set command... worked fine, thanks! Share this post Link to post Share on other sites