Scary!
-
Hi all This is my first post in this forum :eek: Just a small question. Say test = Boolean. In C# i can do
if (test)
to do an if. Can I doIf test Then
this in VB.NET? Does it have same function? I cant test this as it is part of code generation, but it does compile fine :) A simple yes/no appreciated :) Cheers DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET low popularity, please visit :) -
Hi all This is my first post in this forum :eek: Just a small question. Say test = Boolean. In C# i can do
if (test)
to do an if. Can I doIf test Then
this in VB.NET? Does it have same function? I cant test this as it is part of code generation, but it does compile fine :) A simple yes/no appreciated :) Cheers DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET low popularity, please visit :)Come yay or nay, I'll make it easier vote 5 for yes 1 for no! :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)
-
Come yay or nay, I'll make it easier vote 5 for yes 1 for no! :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)
Sure you can do it...
Private Sub cmdTrue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdTrue.Click
BoolTest(True)End Sub
Private Sub cmdFalse_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdFalse.Click
BoolTest(False)End Sub
Private Sub BoolTest(ByVal testValue As Boolean)
If (testValue) Then MessageBox.Show("True!") Else MessageBox.Show("False!") End If
End Sub
Does what I expect it to do... Paul Watson wrote: At the end of the day it is what you produce that counts, not how many doctorates you have on the wall.
-
Sure you can do it...
Private Sub cmdTrue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdTrue.Click
BoolTest(True)End Sub
Private Sub cmdFalse_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdFalse.Click
BoolTest(False)End Sub
Private Sub BoolTest(ByVal testValue As Boolean)
If (testValue) Then MessageBox.Show("True!") Else MessageBox.Show("False!") End If
End Sub
Does what I expect it to do... Paul Watson wrote: At the end of the day it is what you produce that counts, not how many doctorates you have on the wall.
Ray Cassick wrote: If (testValue) Then is this kosher then?
If testValue Then
...without the brackets? The CodeDOmGenerator emits it like that.... O ye thanks :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)
-
Ray Cassick wrote: If (testValue) Then is this kosher then?
If testValue Then
...without the brackets? The CodeDOmGenerator emits it like that.... O ye thanks :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)
Yes, with or without parentheses works fine for VB.NET. cheers, steve
-
Ray Cassick wrote: If (testValue) Then is this kosher then?
If testValue Then
...without the brackets? The CodeDOmGenerator emits it like that.... O ye thanks :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)
Yes, without the parems is fine.. That's just the style I became used to using. Paul Watson wrote: At the end of the day it is what you produce that counts, not how many doctorates you have on the wall.
-
Yes, without the parems is fine.. That's just the style I became used to using. Paul Watson wrote: At the end of the day it is what you produce that counts, not how many doctorates you have on the wall.
:) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)