Re: [RESOLVED] Logic jam....
To understand what Paul did, the "msg &=" is what appends any and or all of the instances in the msgbox?
Re: [RESOLVED] Logic jam....
the msg &= part either appends the control name or nothing to the string depending on the conditional part of the if
if(conditional part, truePart, falsePart)
Re: [RESOLVED] Logic jam....
Try this:
vb.net Code:
Dim flags() As Boolean = {sLbFlag1, sLbFlag2, sLbFlag3, sLbFlag4, sLbFlag5}
Dim controls() As Control = {ListBox1, TextBox2, TextBox3, TextBox4, TextBox5}
If flags.Contains(False) Then
Dim msg As String = "Following must be completed to continue:" & vbCrLf
For i = 0 To flags.Count - 1
If Not flag Then msg &= controls(i).Name & vbCrLf
Next
MessageBox.Show(msg)
Else
'Code removed cause its TSNS (Top Secret Ninja Stuff).
End If
(NB: freehand typed untested code; might contain typos)
Re: [RESOLVED] Logic jam....
Thanks to all who contributed!
Pradeep1210
I'm going to check out your code as well, no harm in learning something new. ;)