I know this is a weird question but what is more weird is the behaviour of .NET about Byte data type.
This is quite possible in VB.NET:
For b As Byte = 14 To 88 Step +10
Console.WriteLine("Byte=" + b.ToString)
Next
But this is not:
For b As Byte = 88 To 14 Step -10
Console.WriteLine("Byte=" + b.ToString)
Next
I would understand if the first example couldn't be possible.
Also, as far as I lookup up, it is not possible to increase or decrease a byte value like this:
Dim b As Byte = 56
b += 1 'not possible
b -= 1 'not possible
So, is this the only way to add/subtract a byte value?
b = CByte(b + 5)
b = CByte(b - 5)
I am asking this because the performance is DEADLY critical for my project, I'm coding a Chess engine and I must think about the memory usage all the times so it's best to store the board info in bytes as possible.
But I have concerns about using CByte() once in a while...