"Sub" is short for...?
-
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.
-
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.
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
-
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
Hi Colin. That was always my guess too - but I wondered (call it a geek obsession) if there were a definitive history to it.
-
Hi Colin. That was always my guess too - but I wondered (call it a geek obsession) if there were a definitive history to it.
-
I've always though it was 'subroutine', and took it for granted...now I wonder... hey...slang is the vernacular for the vernacular...wow
FrankyT wrote:
hey...slang is the vernacular for the vernacular...wow
Ooooohhhh.... :cool:
-
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.
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 :-) -
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.
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
-
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.
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; }