lidds Posted June 14, 2005 Posted June 14, 2005 When I try to loop through an arraylist that I have created, my machine hangs and then visual studio produces a stack overflow error, I obviously doing something wrong, can someone help??? dim myArraylist as new arraylist() myArraylist.add("simon") myArraylist.add("simon1") myArraylist.add("simon2") myArraylist.add("simon3") dim i as integer for i = 0 to myArraylist.count msgbox(myArraylist(i)) next Cheer Simon Quote
Administrators PlausiblyDamp Posted June 14, 2005 Administrators Posted June 14, 2005 If you step through the code does it call any other methods? which line generates the stack overflow? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
lidds Posted June 14, 2005 Author Posted June 14, 2005 it does not call any other method and unfortunately I do not have vs on this machine so am unable to let you know the line number (quite an important bit of info really). But as far as you are aware is the above code written correctly??? Cheers Simon Quote
Administrators PlausiblyDamp Posted June 14, 2005 Administrators Posted June 14, 2005 Can't see anything there that would call a stack overflow. You will get an IndexOutOfRangeException though as you need to loop to myArraylist.count - 1 though. Are you sure that is the code / method that is failing? What is the method itself called? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
MadMaxx Posted June 14, 2005 Posted June 14, 2005 ****EDIT nevermind Didn't read all the posts. :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.