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. "Sub" is short for...?

"Sub" is short for...?

Scheduled Pinned Locked Moved Visual Basic
question
8 Posts 6 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.
  • M Offline
    M Offline
    Mike Ellison
    wrote on last edited by
    #1

    Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC? Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)? I'm not sure why I want to know... just curious, I guess.

    C S G G 4 Replies Last reply
    0
    • M Mike Ellison

      Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC? Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)? I'm not sure why I want to know... just curious, I guess.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I'm guessing it means subrouting. From earlier forms of basic "GO SUB"


      "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        I'm guessing it means subrouting. From earlier forms of basic "GO SUB"


        "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

        M Offline
        M Offline
        Mike Ellison
        wrote on last edited by
        #3

        Hi Colin. That was always my guess too - but I wondered (call it a geek obsession) if there were a definitive history to it.

        F 1 Reply Last reply
        0
        • M Mike Ellison

          Hi Colin. That was always my guess too - but I wondered (call it a geek obsession) if there were a definitive history to it.

          F Offline
          F Offline
          FrankyT
          wrote on last edited by
          #4

          I've always though it was 'subroutine', and took it for granted...now I wonder... hey...slang is the vernacular for the vernacular...wow

          M 1 Reply Last reply
          0
          • F FrankyT

            I've always though it was 'subroutine', and took it for granted...now I wonder... hey...slang is the vernacular for the vernacular...wow

            M Offline
            M Offline
            Mike Ellison
            wrote on last edited by
            #5

            FrankyT wrote:

            hey...slang is the vernacular for the vernacular...wow

            Ooooohhhh.... :cool:

            1 Reply Last reply
            0
            • M Mike Ellison

              Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC? Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)? I'm not sure why I want to know... just curious, I guess.

              S Offline
              S Offline
              Steve Pullan
              wrote on last edited by
              #6

              It is short for "subroutine" - has been as long as I've been involved with computers. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

              1 Reply Last reply
              0
              • M Mike Ellison

                Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC? Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)? I'm not sure why I want to know... just curious, I guess.

                G Offline
                G Offline
                Garner T
                wrote on last edited by
                #7

                Page 422, chapter 9, of "Visual Basic 6 Complete", Table 9.5: Statements Supported in VBScript. Sub - Declares a Subroutine Looking at the example provided, a subroutine is a division or seperate event happening inside of an "event procedure" as described below. Page 42, chapter 4, "Visual Basic 6 For Dummies" In Visual Basic lingo, subprograms are event procedures (although some programmers may call them subroutines). So my understanding would be that a "Sub" is actually an "Event Procedure" and a "Subroutine" is inside of an event procedure and seperated by a marker consisting of an apostrophe followed by a tilde ('~). The example is provided on page 441, chapter 9, of "Visual Basic 6 Complete". Hope this helps, Garner

                1 Reply Last reply
                0
                • M Mike Ellison

                  Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC? Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)? I'm not sure why I want to know... just curious, I guess.

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  It's short for Subroutine. It's an extension to the original BASIC language. In BASIC there are no subroutine structures, only the GOSUB command that jumps to a line number and returns using the RETURN command: 10 GOSUB 40 20 END 30 REM Here follows the subroutine: 40 PRINT "Hello world!" 50 RETURN --- b { font-weight: normal; }

                  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