Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Scary!

Scary!

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasequestioncom
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leppie
    wrote on last edited by
    #1

    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 do If 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 :)

    L 1 Reply Last reply
    0
    • L leppie

      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 do If 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 :)

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      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 :)

      R 1 Reply Last reply
      0
      • L leppie

        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 :)

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • R Ray Cassick

          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.

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          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 :)

          S R 2 Replies Last reply
          0
          • L leppie

            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 :)

            S Offline
            S Offline
            Steven Lyons
            wrote on last edited by
            #5

            Yes, with or without parentheses works fine for VB.NET. cheers, steve

            1 Reply Last reply
            0
            • L leppie

              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 :)

              R Offline
              R Offline
              Ray Cassick
              wrote on last edited by
              #6

              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.

              L 1 Reply Last reply
              0
              • R Ray Cassick

                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.

                L Offline
                L Offline
                leppie
                wrote on last edited by
                #7

                :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups