Array Issue
Monkey Forums/Monkey Programming/Array Issue
| ||
PROBLEM SOLVED: Thanks Mark Is this a bug or am I doing something wrong? Import mojo Class MyApp Extends App Field data:Int[5] Method OnCreate() SetUpdateRate 60 Print data.Length '5 data.Resize(10) Print data.Length 'Why 5 and not 10? End Method OnUpdate() End Method OnRender() Cls End End Function Main() New MyApp End |
| ||
data=data.Resize(10) |
| ||
Thanks Mark |
| ||
LOL! I was fighting this one over the weekend myself - took me a good half an hour before I slammed my head against the desk going "durrrrrrrrrrrrrrrrrr" ;) BTW ordigdug, the code tags are [ code ] [/ code ] - without the spaces. , |
| ||
@therevills Yeah I was at the brink of banging my head when I decided to post, I knew it was something simple. Thanks for the code tags I couldn't remember them and when I click "forum codes" nothing comes up but a blank window currently. |
| ||
With coding problems I always seem to have an epiphany around 2mins after I post on here, even if I have been fighting with it for an hour or two - makes me look really thick lol! |
| ||
http://en.wikipedia.org/wiki/Rubber_duck_debugging |
| ||
@therevills, ordigdug: That's nothing. I haven't use Monkey of a while and spent 45 minutes scratching my head wondering why the code below was loosing precision when doing a division. Strict may catch some programming errors, but not all off them. I think you should be able to see why ;-) |