In article <21****************************@phx.gbl>, chech wrote:
Possible to have array of booleans?
Dim b1 As Boolean, b2 As Boolean, b3 As Boolean
Dim obj() As Object = {b1, b2, b3}
dim v As Object
For Each v In obj
v = True
Next
This does not work. Is it possible to have an array of
booleans that can be set in a loop as above? What would
that look like?
Option Explicit On
Option Strict On
Module Module1
Sub Main()
Dim booleans() As Boolean = {True, True, True, True, True, True}
For Each b As Boolean In booleans
Console.WriteLine(b)
Next b
For i As Integer = 0 To booleans.Length - 1
booleans(i) = False
Next i
For Each b As Boolean In booleans
Console.WriteLine(b)
Next b
End Sub
End Module
--
Tom Shelton [MVP]