Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 'Index outside bounds of array' error randomly in form load sub #424

Closed
liquidforce134 opened this issue May 18, 2018 · 21 comments
Closed

Comments

@liquidforce134
Copy link

liquidforce134 commented May 18, 2018

Product and Version [VS/VSCode]: VS
OS Version [macOS/Windows]: Windows
Live Share Extension Version:
Target Platform or Language [e.g. Node.js]: VB

I've never had this error before and when I took my project home from school and put it on my desktop at my house, it gave me this error. I tried commenting out the array it is giving an error on and the it hit me that this was not my fault but it was a bug with vb.net. It gave me the same error even on an integer variable that I set to 500. Then I commented the integer out and it gave me the same error on the 'end sub' of the form load sub. I am not sure what to do because it worked perfectly fine at school.

Here's the sub code that is getting the error. It gives errors on all the playerpos(). globalbank and end sub but not the arrpieces() or anything above that.

Private Sub frmMonopoly_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    turn = My.Computer.FileSystem.ReadAllText("E:\VB.NETMason\Projects\MONOPOLY\turn.txt")
    arrpieces(1) = picp1
    arrpieces(2) = picp2
    arrpieces(3) = picp3
    arrpieces(4) = picp4
    playerpos(1) = 1     'Error starts here and gives error for all below
    playerpos(2) = 1
    playerpos(3) = 1
    playerpos(4) = 1
    globalbank = 500
End Sub

Thanks

@liquidforce134
Copy link
Author

Just released my vb.net was not updated. I'll reply back when it finishes to see if that fixed it.

@lostintangent
Copy link
Member

@jmw28 Hey! Does this error start occurring only after you install the Live Share extension? If you uninstalled Live Share, does it go away?

@liquidforce134
Copy link
Author

I haven't tried without the extension, but it didn't give me errors on the pc's we have at school which we have the extension on as well.

@lostintangent
Copy link
Member

@jmw28 Are you seeing this error after sharing your project or joining a Live Share session? Or are you just seeing this error after simply opening the project up in VS?

@liquidforce134
Copy link
Author

I haven't shared it with anyone so it is just once I opened the project. At school we did have it shared though.

@lostintangent
Copy link
Member

@jmw28 Hmm, OK. Could you try to uninstall Live Share from your home PC just to double-check? That way we can narrow down whether the issue is related to Live Share or not? It sounds like Live Share was working fine at school?

@liquidforce134
Copy link
Author

I'll do that after this update installs. Live share works great at school except for the fact that guests can't see the windows form and all their lines have red underlines. Other than that, it works great!

@liquidforce134
Copy link
Author

Ok, the update did not fix the problem. I'll uninstall live share and see if that works.

@lostintangent
Copy link
Member

lostintangent commented May 18, 2018

@jmw28 If you go to the Tools -> Extensions and Updates... menu, you'll be able to uninstall the Live Share extension.

Regarding the two items you mentioned:

  1. We have a feature request tracking the work to allow sharing desktop windows. An upvote would be greatly appreciated 👍 (Allow hosts to share desktop windows #236)

  2. The "red squiggles everywhere" is a known issue that we'll be fixing soon.

@liquidforce134
Copy link
Author

How do I go about uninstalling live share?

@lostintangent
Copy link
Member

@jmw28 If you go to the Tools -> Extensions and Updates... menu, you should see VS Live Share - Preview in the list of Installed extensions. If you select it, you can click the Uninstall button, and then restart VS.

@liquidforce134
Copy link
Author

Great thanks!

@liquidforce134
Copy link
Author

On the bight side, it wasn't VS Live Share.

@liquidforce134
Copy link
Author

On the not so bright side, it is still displaying the error.

@lostintangent
Copy link
Member

@jmw28 That's great to confirm, since I couldn't imagine why Live Share would be causing this issue :) Regarding the actual error though, are you sure that you defined the playerpos array to have the sufficient array size?

@liquidforce134
Copy link
Author

liquidforce134 commented May 18, 2018

I defined playerpos in global as playerpos(4) as integer which is the right size. As I said before, it was working and I didn't change a single thing.

@liquidforce134
Copy link
Author

I'll see if I have a problem tomorrow when I get back to school. Thanks for the help!

@lostintangent
Copy link
Member

Always happy to help! Do you want to keep this issue open, or do you think we’ve confirmed that it’s unrelated to Live Share?

@liquidforce134
Copy link
Author

I think it's confirmed. Thanks for the help again! I can't wait until this live share feature is 100%, it will help so much in group projects!

@lostintangent
Copy link
Member

Thanks for the feedback! We definitely want to support group project collaboration well, and I’ll ping you when we make progress on the two items you mentioned. Thanks!

@liquidforce134
Copy link
Author

Sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants