.NET Unrecognized List and Split Count

Hello,

Yesterday and today i expected two bugs on games with the .NET.

Yesterday, i had a code like this:

For i = 0 to text.split("_").count - 1

And the game was showing an error like the “i” was not recognized… This code works on my others projects.
The bug happens with the code: .split(“string”).count
The .count create the bug.

And today, i expected a bug with the List declaration.

The error was: error VBNC30451: ‘List’ is not declared. It may be inaccessible due to its protection level.

The code is:

The program doesn’t recognize “New list”

Thanks,
Best regards

Your variable is recognized if you type it and you should use length instead of count from what I see in the doc of VB.NET
Try this :

For i as Integer = 0 to text.split("_").length -1

Hello Aveuh,

The .length is working it’s recognized but on my others projects, i was always using .count, this bug happens only with the game :blush:

Tested on Onboarding:

    For i as Integer = 0 To enemy1.Length - 1 
        Console.Error.WriteLine(enemy1.Substring(i,1))
    Next

Result:
N
o
b
o
d
y

Just as expected.

Sorry my fault, the Substring was working.