VB "Call" syntax vs command-style syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Jorgensen

    VB "Call" syntax vs command-style syntax

    I'm looking for coding style opinions.

    It looks to me like most VB/VBA coders use the command-style syntax for
    calling subs or functions being treated as subs in a particular context ...

    Foo "ABC", varDest

    Occasionally, I see code using the Call syntax instead.

    Call Foo("ABC", varDest)

    I used to find that wierd, but now, I'm wondering if it isn't really the
    superior style. Basically, I find myself starting to use named parameters
    more (whenever it isn't blatantly obvious what the parameters must be by
    looking at the call line), and I think Call reads easier in these cases. So,
    do be consistent, I'm thinking I might just start using Call in all cases.

    Foo Src:="ABC", Dest:=varDest

    vs

    Call Foo(Src:="ABC", Dest:=varDest)


    Your thoughts?
  • Rick Brandt

    #2
    Re: VB "Call&quot ; syntax vs command-style syntax

    "Steve Jorgensen" <nospam@nospam. nospam> wrote in message
    news:j5skg0hnba k57qnph8apnh7fl 2r4815dua@4ax.c om...[color=blue]
    > I'm looking for coding style opinions.
    >
    > It looks to me like most VB/VBA coders use the command-style syntax for
    > calling subs or functions being treated as subs in a particular context[/color]
    ....[color=blue]
    >
    > Foo "ABC", varDest
    >
    > Occasionally, I see code using the Call syntax instead.
    >
    > Call Foo("ABC", varDest)
    >
    > I used to find that wierd, but now, I'm wondering if it isn't really the
    > superior style. Basically, I find myself starting to use named[/color]
    parameters[color=blue]
    > more (whenever it isn't blatantly obvious what the parameters must be by
    > looking at the call line), and I think Call reads easier in these cases.[/color]
    So,[color=blue]
    > do be consistent, I'm thinking I might just start using Call in all[/color]
    cases.

    I've always used Call. Seems more self-documenting to me.


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • Tom van Stiphout

      #3
      Re: VB &quot;Call&quot ; syntax vs command-style syntax

      On Fri, 30 Jul 2004 16:00:29 GMT, Steve Jorgensen
      <nospam@nospam. nospam> wrote:

      You'll have to un-learn it once you write code in VB.NET

      In the VBA environment I find Call more similar to function calls, and
      I like it for that reason.

      -Tom.

      [color=blue]
      >I'm looking for coding style opinions.
      >
      >It looks to me like most VB/VBA coders use the command-style syntax for
      >calling subs or functions being treated as subs in a particular context ...
      >
      > Foo "ABC", varDest
      >
      >Occasionally , I see code using the Call syntax instead.
      >
      > Call Foo("ABC", varDest)
      >
      >I used to find that wierd, but now, I'm wondering if it isn't really the
      >superior style. Basically, I find myself starting to use named parameters
      >more (whenever it isn't blatantly obvious what the parameters must be by
      >looking at the call line), and I think Call reads easier in these cases. So,
      >do be consistent, I'm thinking I might just start using Call in all cases.
      >
      > Foo Src:="ABC", Dest:=varDest
      >
      >vs
      >
      > Call Foo(Src:="ABC", Dest:=varDest)
      >
      >
      >Your thoughts?[/color]

      Comment

      • Sherwood Wang

        #4
        Re: VB &quot;Call&quot ; syntax vs command-style syntax


        "Steve Jorgensen" <nospam@nospam. nospam> wrote in message
        news:j5skg0hnba k57qnph8apnh7fl 2r4815dua@4ax.c om...[color=blue]
        > I'm looking for coding style opinions.
        >
        > It looks to me like most VB/VBA coders use the command-style syntax for
        > calling subs or functions being treated as subs in a particular context[/color]
        ....[color=blue]
        >
        > Foo "ABC", varDest
        >
        > Occasionally, I see code using the Call syntax instead.
        >
        > Call Foo("ABC", varDest)
        >
        > I used to find that wierd, but now, I'm wondering if it isn't really the
        > superior style. Basically, I find myself starting to use named parameters
        > more (whenever it isn't blatantly obvious what the parameters must be by
        > looking at the call line), and I think Call reads easier in these cases.[/color]
        So,[color=blue]
        > do be consistent, I'm thinking I might just start using Call in all cases.
        >
        > Foo Src:="ABC", Dest:=varDest
        >
        > vs
        >
        > Call Foo(Src:="ABC", Dest:=varDest)
        >
        >
        > Your thoughts?[/color]


        call foo racist. i not call jorgensen true?

        *Sherwood Wang MVP*



        Comment

        • Larry  Linson

          #5
          Re: VB &quot;Call&quot ; syntax vs command-style syntax

          "Sherwood Wang" <shwang@waynes. net> wrote
          [color=blue]
          > call foo racist. i not call jorgensen true?
          >
          > *Sherwood Wang MVP*[/color]

          I call dialect posting by a genuine Mellon sockpuppet racist.

          I call this signature an impersonation. To see a list of actual MVPs, see
          http://mvp.support.microsoft.com/def...ward&style=toc .

          Larry Linson
          Microsoft Access MVP


          Comment

          • Sherwood Wang

            #6
            Re: VB &quot;Call&quot ; syntax vs command-style syntax


            "Larry Linson" <bouncer@localh ost.not> wrote in message
            news:OB%Oc.2687 $UN2.1885@nwrdd c02.gnilink.net ...[color=blue]
            > "Sherwood Wang" <shwang@waynes. net> wrote
            >[color=green]
            > > call foo racist. i not call jorgensen true?
            > >
            > > *Sherwood Wang MVP*[/color]
            >
            > I call dialect posting by a genuine Mellon sockpuppet racist.
            >
            > I call this signature an impersonation. To see a list of actual MVPs, see
            >[/color]
            http://mvp.support.microsoft.com/def...ward&style=toc .[color=blue]
            >
            > Larry Linson
            > Microsoft Access MVP
            >[/color]

            you english not so very large mr larry linson. not make fun on me please
            AND not make fun on asian people please AND not call me wrong name okay
            please? may name on list yu hong chi win wang = sherwood wang by friends
            which you not. than you very much please.

            *Sherwood Wang MVP*






            Comment

            • Larry  Linson

              #7
              Re: VB &quot;Call&quot ; syntax vs command-style syntax

              If you are, indeed, Yu Hong Wang, MVP, continue this communication in the
              private MVP newsgroup for Access. If I do not see you posting there, it will
              confirm that you are a Don P Mellon sockpuppet or tagalong troll
              impersonating Yu Hong Wang.

              If I do see your message there (and the other MVPs who participate here will
              see it, too) I will offer my apology.

              However, given that MVPs who participate here actually answer questions,
              instead of posting inane, off-topic messages, until then, G'day, Donnie.

              Larry Linson
              Microsoft Access MVP


              "Sherwood Wang" <shwang@waynes. net> wrote in message
              news:5f8Pc.9803 8$vJ6.83832@cyc lops.nntpserver .com...[color=blue]
              >
              > "Larry Linson" <bouncer@localh ost.not> wrote in message
              > news:OB%Oc.2687 $UN2.1885@nwrdd c02.gnilink.net ...[color=green]
              > > "Sherwood Wang" <shwang@waynes. net> wrote
              > >[color=darkred]
              > > > call foo racist. i not call jorgensen true?
              > > >
              > > > *Sherwood Wang MVP*[/color]
              > >
              > > I call dialect posting by a genuine Mellon sockpuppet racist.
              > >
              > > I call this signature an impersonation. To see a list of actual MVPs,[/color][/color]
              see[color=blue][color=green]
              > >[/color]
              >[/color]
              http://mvp.support.microsoft.com/def...ward&style=toc .[color=blue][color=green]
              > >
              > > Larry Linson
              > > Microsoft Access MVP
              > >[/color]
              >
              > you english not so very large mr larry linson. not make fun on me please
              > AND not make fun on asian people please AND not call me wrong name okay
              > please? may name on list yu hong chi win wang = sherwood wang by friends
              > which you not. than you very much please.
              >
              > *Sherwood Wang MVP*
              >
              >
              >
              >
              >
              >[/color]


              Comment

              • Larry  Linson

                #8
                Re: VB &quot;Call&quot ; syntax vs command-style syntax

                "Sherwood Wang" <shwang@waynes. net>

                We are waiting for your post in the private mvp newsgroup for Access,
                "Sherwood". The real Yu Hong Wang has access to that newsgroup.


                Comment

                • Sherwood Wang

                  #9
                  Re: VB &quot;Call&quot ; syntax vs command-style syntax



                  "Larry Linson" <bouncer@localh ost.not> wrote in message
                  news:iy9Pc.3525 $QA5.1604@nwrdd c01.gnilink.net ...[color=blue]
                  > If you are, indeed, Yu Hong Wang, MVP, continue this communication in the
                  > private MVP newsgroup for Access. If I do not see you posting there, it[/color]
                  will[color=blue]
                  > confirm that you are a Don P Mellon sockpuppet or tagalong troll
                  > impersonating Yu Hong Wang.
                  >
                  > If I do see your message there (and the other MVPs who participate here[/color]
                  will[color=blue]
                  > see it, too) I will offer my apology.
                  >
                  > However, given that MVPs who participate here actually answer questions,
                  > instead of posting inane, off-topic messages, until then, G'day, Donnie.
                  >
                  > Larry Linson
                  > Microsoft Access MVP
                  >
                  >[/color]


                  mr larry linson i post 1 time i post 2 time. you apology now please. or as
                  many you say go fly the kike!

                  *Sherwood Wang MVP*


                  Comment

                  • Larry  Linson

                    #10
                    Re: VB &quot;Call&quot ; syntax vs command-style syntax

                    "Sherwood Wang" wrote
                    [color=blue][color=green]
                    > > If you are, indeed, Yu Hong Wang, MVP,
                    > > continue this communication in the private
                    > > MVP newsgroup for Access. If I do not
                    > > see you posting there, it will confirm that
                    > > you are a Don P Mellon sockpuppet or
                    > > tagalong troll impersonating Yu Hong Wang.[/color][/color]
                    [color=blue][color=green]
                    > > If I do see your message there (and the
                    > > other MVPs who participate here will
                    > > see it, too) I will offer my apology.
                    > >
                    > > However, given that MVPs who participate
                    > > here actually answer questions, instead of
                    > > posting inane, off-topic messages, until then,
                    > > G'day, Donnie.[/color][/color]
                    [color=blue]
                    > mr larry linson i post 1 time i post 2 time.
                    > you apology now please. or as
                    > many you say go fly the kike!
                    >
                    > *Sherwood Wang MVP*[/color]

                    You are not the MVP Yu Hong Wang as you claimed. Trolls and sockpuppets do
                    not get apologies, even for real slights, much less the imagined one that
                    you claim.

                    Donnie, don't you think that the MVPs have communication within their own
                    community?

                    You are really showing your ignorance, here, with this silly attempt at
                    "broken English" -- apparently you have not known the Chinese I have, most
                    of whom speak better English on a bad day than a Mellon-troll does on a good
                    day.

                    G'day, Donnie.

                    Larry Linson
                    Microsoft Access MVP


                    Comment

                    • James Fortune

                      #11
                      Re: VB &quot;Call&quot ; syntax vs command-style syntax

                      "Larry Linson" <bouncer@localh ost.not> wrote in message news:<iy9Pc.352 5$QA5.1604@nwrd dc01.gnilink.ne t>...[color=blue]
                      > If you are, indeed, Yu Hong Wang, MVP, continue this communication in the
                      > private MVP newsgroup for Access. If I do not see you posting there, it will
                      > confirm that you are a Don P Mellon sockpuppet or tagalong troll
                      > impersonating Yu Hong Wang.
                      >
                      > If I do see your message there (and the other MVPs who participate here will
                      > see it, too) I will offer my apology.
                      >
                      > However, given that MVPs who participate here actually answer questions,
                      > instead of posting inane, off-topic messages, until then, G'day, Donnie.
                      >
                      > Larry Linson
                      > Microsoft Access MVP[/color]

                      Challenge/Response Authentication?

                      James A. Fortune

                      Comment

                      • Trevor Best

                        #12
                        Re: VB &quot;Call&quot ; syntax vs command-style syntax

                        James Fortune wrote:[color=blue]
                        > "Larry Linson" <bouncer@localh ost.not> wrote in message news:<iy9Pc.352 5$QA5.1604@nwrd dc01.gnilink.ne t>...
                        >[color=green]
                        >>If you are, indeed, Yu Hong Wang, MVP, continue this communication in the
                        >>private MVP newsgroup for Access. If I do not see you posting there, it will
                        >>confirm that you are a Don P Mellon sockpuppet or tagalong troll
                        >>impersonati ng Yu Hong Wang.
                        >>
                        >>If I do see your message there (and the other MVPs who participate here will
                        >>see it, too) I will offer my apology.
                        >>
                        >>However, given that MVPs who participate here actually answer questions,
                        >>instead of posting inane, off-topic messages, until then, G'day, Donnie.
                        >>
                        >> Larry Linson
                        >> Microsoft Access MVP[/color]
                        >
                        >
                        > Challenge/Response Authentication?
                        >
                        > James A. Fortune[/color]

                        Well he's a good CHAP :-)

                        --
                        Error reading sig - A)bort R)etry I)nfluence with large hammer

                        Comment

                        • Sherwood Wang

                          #13
                          Re: VB &quot;Call&quot ; syntax vs command-style syntax


                          "Larry Linson" <bouncer@localh ost.not> wrote in message
                          news:_M9Qc.2221 6$UN2.14224@nwr ddc02.gnilink.n et...[color=blue]
                          > "Sherwood Wang" wrote
                          >[color=green][color=darkred]
                          > > > If you are, indeed, Yu Hong Wang, MVP,
                          > > > continue this communication in the private
                          > > > MVP newsgroup for Access. If I do not
                          > > > see you posting there, it will confirm that
                          > > > you are a Don P Mellon sockpuppet or
                          > > > tagalong troll impersonating Yu Hong Wang.[/color][/color]
                          >[color=green][color=darkred]
                          > > > If I do see your message there (and the
                          > > > other MVPs who participate here will
                          > > > see it, too) I will offer my apology.
                          > > >
                          > > > However, given that MVPs who participate
                          > > > here actually answer questions, instead of
                          > > > posting inane, off-topic messages, until then,
                          > > > G'day, Donnie.[/color][/color]
                          >[color=green]
                          > > mr larry linson i post 1 time i post 2 time.
                          > > you apology now please. or as
                          > > many you say go fly the kike!
                          > >
                          > > *Sherwood Wang MVP*[/color]
                          >
                          > You are not the MVP Yu Hong Wang as you claimed. Trolls and sockpuppets do
                          > not get apologies, even for real slights, much less the imagined one that
                          > you claim.
                          >
                          > Donnie, don't you think that the MVPs have communication within their own
                          > community?
                          >
                          > You are really showing your ignorance, here, with this silly attempt at
                          > "broken English" -- apparently you have not known the Chinese I have, most
                          > of whom speak better English on a bad day than a Mellon-troll does on a[/color]
                          good[color=blue]
                          > day.
                          >
                          > G'day, Donnie.
                          >
                          > Larry Linson
                          > Microsoft Access MVP
                          >[/color]


                          i not chinese. you rascist bad moron.

                          *Sherwood Wang MVP*


                          Comment

                          • Larry  Linson

                            #14
                            Re: VB &quot;Call&quot ; syntax vs command-style syntax


                            "Sherwood Wang" <shwang@waynes. net> wrote
                            [color=blue]
                            > i not chinese. you rascist bad moron.
                            >
                            > *Sherwood Wang MVP*[/color]

                            You claimed to be the MVP Yu Hong Wang, who is Chinese, and you are
                            denigrating Chinese with your silly attempts at "dialect", Donnie. Put away
                            your sockpuppet and go answer some real Access questions.


                            Comment

                            • Scott Barker

                              #15
                              Re: VB &quot;Call&quot ; syntax vs command-style syntax


                              "Larry Linson" <bouncer@localh ost.not> wrote in message
                              news:J0XRc.9862 $BO.1182@nwrddc 03.gnilink.net. ..[color=blue]
                              >
                              > "Sherwood Wang" <shwang@waynes. net> wrote
                              >[color=green]
                              > > i not chinese. you rascist bad moron.
                              > >
                              > > *Sherwood Wang MVP*[/color]
                              >
                              > You claimed to be the MVP Yu Hong Wang, who is Chinese, and you are
                              > denigrating Chinese with your silly attempts at "dialect", Donnie. Put[/color]
                              away[color=blue]
                              > your sockpuppet and go answer some real Access questions.
                              >[/color]


                              Larry,

                              Yu is of Taiwanese descent. I'd suggest you drop this thread before you
                              cause more trouble than you have already.

                              F. Scott Barker, Access MVP


                              Comment

                              Working...