VB6 vs VB.NET...Procedure Calling Syntax - Page 5


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 5 of 6 FirstFirst ... 3456 LastLast
Results 61 to 75 of 79

Thread: VB6 vs VB.NET...Procedure Calling Syntax

  1. #61
    Daniel Pratt Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    "Patrick Troughton" <Patrick@Troughton.com> wrote in message
    news:3d57b115$1@10.1.10.29...
    >
    > There are two categories of statements in Visual Basic, declaration

    statemtens
    > and executable statements. This is from the Visual Basic documentation....

    <snip lengthy quotes from documentation>

    Just the same, I think...[*Just then Daniel's chair bumps the adjacent
    bookshelf, which causes Dan Appleman's API Guide to tumble from its
    precarious position above Daniel's head. Cue unconscious dream sequence*]

    Defense Attorney: Your Honor, my client is prepared to stipulate that the VB
    language architects clearly categorize AddHandler as a statement.

    Judge: So stipulated. What does the defendant have to say for himself?

    Defendant: Two words, your Honor, "Pro Forma"...or is that one word, your
    Honor, I'm not sure...maybe its a term...well anyway, all other statements
    in VB have special meaning beyond simply executing a routine.

    Judge: Like what?

    Defendant: Like allocating variables, your Honor, denoting application
    structure, or denoting code logic or flow. AddHandler merely executes a
    routine. Furthermore, AddHandler accepts two arguments separated by commas,
    which further gives it the form of a method.

    Prosecutor: Oh yeah, what about the Mid statement?

    Defendant: Your Honor, firstly, Mid *does* require parens around its
    arguments, and secondly, Mid is just weird.

    Judge: What do you mean, weird?

    Defendant: Your Honor, in VB the value of an expression can be assigned to a
    property or variable. The syntax of Mid would indicate that you are
    assigning to the result of a function, which is highly irregular, but I
    digress.

    Prosecutor: Your Honor, this is all moot. AddHandler is a *statement*.

    Judge: On what basis?

    Prosecutor: The documentation, your Honor.

    Judge: The defense has already stipulated the documentation's position on
    this matter. Is there any other characteristic of AddHandler that would
    differentiate it from a method?

    Prosecutor: Hey, wake up, dude!

    Defendant: What do you mean, wake up?

    [*Daniel slowly regains consciousness. End unconscious dream sequence*]

    Office-mate: Dude, wake up! Are you all right?

    Daniel: I think so. What happened?

    Office-mate: I don't know. You were mumbling something about "...legalistic
    blah blah inconsistent blah blah..."

    [*cut scene*]

    Hey, that was fun. I guess this post is what happens when you spend your
    sleeping hours in the ER :0)

    Regards,
    Dan



  2. #62
    Patrick Troughton Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    I read his posts. They're evasive....he keeps avoiding the core issues. AddHandler
    is a statement, not a procedure. AddHandler is no different than If...End
    If statements and For...Next statements. All of these statements run executable
    code behind the scenes and none of them require parens. If he would read
    the documention, he would know that. That's the way it was in VB6. And that's
    the way it is in VB.NET. This hasn't changed one bit.

    Further, the Visual Basic documentation backs me up 100%. If you don't want
    to take my word for it, that's fine. Just read the VB docs and see for yourself.

    I think it's very telling that he keeps avoiding the subject. The topic of
    this thread is supposed to be "VB6 vs VB.NET...Procedure Calling Syntax"
    but he's done everything but discuss Visual Basic and procedures. ****, he's
    not even talking about VB anymore. He talking about QuickBasic! Talk about
    grasping for straws....

    /Pat

    "MMFAN" <mmf@mmf.org> wrote:
    >
    >You're the one who is missing the point. Do your work reread his posts.


    >Don't be lazy!
    >
    >"Patrick Troughton" <Patrick@Troughton.com> wrote:
    >>
    >>Come on Dan, you keep avoiding the issues. Directly from the Visual Basic
    >>documentation.....
    >>
    >><quote>
    >>AddHandler Statement
    >>
    >>See Also
    >>RemoveHandler Statement | Handles | Events and Event Handlers | AddHandler
    >>and RemoveHandler
    >>
    >>Associates an event with an event handler.
    >></quote>
    >>
    >>Please tell me what the second word is above, immediately after AddHandler?
    >>


  3. #63
    Karl E. Peterson Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    "Patrick Troughton" <Patrick@Troughton.com> wrote in message
    news:3d57cedd$1@10.1.10.29...
    >
    > AddHandler is a statement, not a procedure.


    I bet you *stomped* you widdle foot when you typed that - am I right? LOL!!!

    Pull yer head out, Pat.
    --
    [Microsoft Basic: 1976-2001, RIP]




  4. #64
    Karl E. Peterson Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    Right on! TOTAL CONSISTENCY DICTATES that If should have its parameters in
    parenthesis, as well!

    Y'know, like Java or even JavaScript...

    if (top != self) {
    top.location.href = location.href;
    }

    (Is he getting it yet? LOL!)
    --
    [Microsoft Basic: 1976-2001, RIP]


    "Patrick Troughton" <Patrick@Troughton.com> wrote in message
    news:3d57b24b$1@10.1.10.29...
    >
    > Come on, Dan. You keep avoiding the issues. Whether a statement calls excutable
    > code behind the scenes is irrelevent. How do you think an If statement works
    > if not by calling executable code?
    >
    > /Pat
    >
    > "Patrick Troughton" <Patrick@Troughton.com> wrote:
    > >
    > >I didn't overlook it. I addressed it head on. AddHandler is a statement,

    > not
    > >a procedure. Whether a statement calls excutable code behind the scenes

    > is
    > >irrelevent. Again, I refer you to the If...End If statement. How do you

    > think
    > >an If statement works if not by calling executable code? Hint...it's called
    > >a branch.
    > >
    > >/Pat

    >



  5. #65
    Patrick Troughton Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    "Karl E. Peterson" <karl@mvps.org> wrote:
    >Right on! TOTAL CONSISTENCY DICTATES..


    I never said anything about consistency. That was Dan's point, not mine.
    I was talking about simplicity and ease of use. Go back and read my original
    post if you don't believe me....

    /Pat

  6. #66
    Karl E. Peterson Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    "Patrick Troughton" <Patrick@Troughton.com> wrote in message
    news:3d582e33$1@10.1.10.29...
    >
    > "Karl E. Peterson" <karl@mvps.org> wrote:
    > >Right on! TOTAL CONSISTENCY DICTATES..

    >
    > I never said anything about consistency. That was Dan's point, not mine.
    > I was talking about simplicity and ease of use. Go back and read my original
    > post if you don't believe me....


    LOL! Yeah, sure. Why again is VFred "easier"?

    (Go back and read your original post, if you don't remember.)
    --
    [Microsoft Basic: 1976-2001, RIP]


  7. #67
    Dan Barclay Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    Yes indeed, the word is Statement.

    Now, what do you think happens when you execute that Statement?
    Surprise! It executes a procedure!

    Executable statements execute a procedure. Who'd have thunk it.

    Dan

    On 12 Aug 2002 06:06:12 -0700, "Patrick Troughton"
    <Patrick@Troughton.com> wrote:

    >
    >Come on Dan, you keep avoiding the issues. Directly from the Visual Basic
    >documentation.....
    >
    ><quote>
    >AddHandler Statement
    >
    >See Also
    >RemoveHandler Statement | Handles | Events and Event Handlers | AddHandler
    >and RemoveHandler
    >
    >Associates an event with an event handler.
    ></quote>
    >
    >Please tell me what the second word is above, immediately after AddHandler?
    >
    >/Pat
    >
    >"Patrick Troughton" <Patrick@Troughton.com> wrote:
    >>
    >>Directly from the Visual Basic documentation.....
    >>
    >><quote>
    >>AddHandler Statement
    >>
    >>See Also
    >>RemoveHandler Statement | Handles | Events and Event Handlers | AddHandler
    >>and RemoveHandler
    >>
    >>Associates an event with an event handler.
    >></quote>
    >>
    >>Can you please read the second word above, immediately after AddHandler?
    >>Hint...this word is spelled S T A T E M E N T.
    >>


    Language Stability is a *feature* I wish VB had!
    (#6)
    Error 51
    Error 3
    Error 9
    ....

  8. #68
    Dan Barclay Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    On 12 Aug 2002 05:59:01 -0700, "Patrick Troughton"
    <Patrick@Troughton.com> wrote:

    <snip some BS>

    >What's more, this is no different than VB6.


    What is different is that user created statements now have a different
    syntax.

    Again, if you want to be consistent with the language (leading to a
    simpler, more easily understood syntax) you would also make built in
    statements use this same syntax. Maybe something like:

    Public Sub StartWidget(aWidget As Widget, clockwise As Boolean, _
    revolutions As Integer)
    Dim (counter As Integer)
    If (clockwise = True)
    {
    For (counter = 1,counter=revolutions,counter++)
    {
    aWidget.SpinClockwise
    }

    }
    Else
    {
    For (counter = 1,counter=revolutions,counter++)
    {
    aWidget.SpinCounterClockwise
    }
    }
    End Sub

    By the way, "Next counter" is sooooo old school. Get with the program
    Pat.

    Quack.

    Dan
    Language Stability is a *feature* I wish VB had!
    (#6)
    Error 51
    Error 3
    Error 9
    ....

  9. #69
    Patrick Troughton Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    Dan Barclay <Dan@MVPs.org> wrote:
    >Yes indeed, the word is Statement.


    Thank you!

    >Now, what do you think happens when you execute that Statement?
    >Surprise! It executes a procedure!


    Correct, that's why it's called an executable statement, just like all the
    other executable statements in the Visual Basic language.

    >Executable statements execute a procedure.


    Yep, that's the way it was in VB6. That's the way it is in VB.NET.

    /Pat

  10. #70
    Patrick Troughton Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    If you're trying to say that in VB6 you could call a procedure without using
    parens, whereas in VB.NET you have to...no sh*t. I said that in my very first
    post.

    /Pat

    Dan Barclay <Dan@MVPs.org> wrote:
    >On 12 Aug 2002 05:35:51 -0700, "Patrick Troughton"
    ><Patrick@Troughton.com> wrote:
    >
    >>
    >>Dan Barclay <Dan@MVPs.org> wrote:
    >>>
    >>> First, that's not what we were discussing (until you chose to take
    >>>some strange tangent). PLEASE note the title of this thread!

    >>
    >>What bizarro world do you live in? The subject of this thread is VB6 vs

    VB.NET...Procedure
    >>Calling Syntax. So far, you have done everything *but* discuss procedure
    >>calling syntax. ****, you're not even talking about Visual Basic....

    >
    >Let's take this again (with a short version) from the top.
    >
    > 1. The *procedure calling syntax* of VB6 (and before) allowed you
    >to *call the procedure* using a user defined statement syntax that
    >*called the procedure*. This syntax was identical to the syntax of
    >built-in executable statements that executed built-in procedures.
    >
    > 2. I have noted the change in syntax with VB.Net in which the
    >"user defined statement" form if the procedure call now requires
    >parenthesis such that its syntax is different from built-in executable
    >statements (which call internal procedures) and breaks code
    >originating in VB6
    >
    > 3. In order to convince you that this was the intended usage of
    >this syntax in VB6, I quoted you from previous documentation
    >(approximately the timeframe the feature was introduced to the
    >language) stating the intent of the syntax explicitly.
    >
    >Note above the direct references to "procedure calling syntax", VB6,
    >and VB.Net.
    >
    >What part of this do you not understand?
    >
    >Dan
    >Language Stability is a *feature* I wish VB had!
    > (#6)
    >Error 51
    >Error 3
    >Error 9
    >....



  11. #71
    Dan Barclay Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    On 12 Aug 2002 16:44:44 -0700, "Patrick Troughton"
    <Patrick@Troughton.com> wrote:

    >
    >Dan Barclay <Dan@MVPs.org> wrote:
    >>Yes indeed, the word is Statement.

    >
    >Thank you!
    >
    >>Now, what do you think happens when you execute that Statement?
    >>Surprise! It executes a procedure!

    >
    >Correct, that's why it's called an executable statement, just like all the
    >other executable statements in the Visual Basic language.
    >
    >>Executable statements execute a procedure.

    >
    >Yep, that's the way it was in VB6. That's the way it is in VB.NET.


    Except that in VB.Net the executable statements use different argument
    syntax (rules) depending on whether the executable statement
    originated as an internal procedure or a user written procedure.

    Man, it took us a long time to get here. Glad we finally did.

    Dan
    Language Stability is a *feature* I wish VB had!
    (#6)
    Error 51
    Error 3
    Error 9
    ....

  12. #72
    Dan Barclay Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    On 12 Aug 2002 16:44:55 -0700, "Patrick Troughton"
    <Patrick@Troughton.com> wrote:

    >
    >If you're trying to say that in VB6 you could call a procedure without using
    >parens, whereas in VB.NET you have to...no sh*t. I said that in my very first
    >post.


    Right. In case you forgot, the issue you took up arms about was
    whether this syntax was called a "statement' or not.

    User statements and built-in statements now use different syntax
    (rules) governing whether you enclose argument lists in parenthesis.

    Prior to VB.Net (from the time they were introduced to the language
    through VB6) they were consistent.

    Dan
    Language Stability is a *feature* I wish VB had!
    (#6)
    Error 51
    Error 3
    Error 9
    ....

  13. #73
    Kunle Odutola Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    "Dan Barclay" <Dan@MVPs.org> wrote in message
    news:ndlglu46apmn7vg3531hckj79m5q7b2k73@4ax.com...

    > User statements and built-in statements now use different syntax
    > (rules) governing whether you enclose argument lists in parenthesis.


    Right on Dan. I can't figure any way to recreate my fave While..End
    statement just because of this. Best I can do is:

    VBClassicStuff.RunWhileEnd(loopCondition, loopStatements);

    <g>

    Kunle



  14. #74
    Mike Mitchell Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax

    On Mon, 12 Aug 2002 17:35:33 -0500, Dan Barclay <Dan@MVPs.org> wrote:

    >Now, what do you think happens when you execute that Statement?
    >Surprise! It executes a procedure!


    Sorry, Dan, I don't this can be right. My information is that when a
    "Statement" is executed, certain members of congress conjugate in an
    anteroom off Bel-Aire Drive for coffee and muffins. There they speak
    about world problems and, if not too drunk on their own
    self-importance, come to conclusions which are then fed to a group of
    warlords in Outer Mongolia via fax. We all know the provision of
    horses there is really dire, and zebras, let alone donkeys, asses and
    mules don't really gallop in quite the same way. It's this problem
    which all "Statements" are endeavouring to fix - from the outside in,
    or, failing that, from the inside out. Meanwhile, said members of
    congress, now exhausted, are secretly returning to their desks and
    normal business is resumed within just a matter of minutes.

    Of course, I may be wrong about this, and statements could just be
    calling procedures, as you suggest. But such a bizarre suggestion is
    really difficult for some people to assimilate, which is why I thought
    of the alternative, much more sensible, "zebra" problem paradigm.

    MM

  15. #75
    Daniel Pratt Guest

    Re: VB6 vs VB.NET...Procedure Calling Syntax


    "Dan Barclay" <Dan@MVPs.org> wrote in message
    news:29eglu4tfael8n8c07ec0u32qi2ijij94i@4ax.com...
    <snip>
    > What is different is that user created statements now have a different
    > syntax.
    >
    > Again, if you want to be consistent with the language (leading to a
    > simpler, more easily understood syntax) you would also make built in
    > statements use this same syntax. Maybe something like:
    >

    <snip VBC# code>
    >
    > By the way, "Next counter" is sooooo old school. Get with the program
    > Pat.
    >
    > Quack.


    I was wondering when you would take this to its illogical conclusion.

    Regards,
    Dan



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center