Podcast
Questions and Answers
What does GOSUB do in early BASIC variants?
What does GOSUB do in early BASIC variants?
What happens when an argument is passed ByRef?
What happens when an argument is passed ByRef?
In Microsoft Small Basic, what is the keyword used to denote the start of a subroutine?
In Microsoft Small Basic, what is the keyword used to denote the start of a subroutine?
In C and C++, what is a function that does not return a value called?
In C and C++, what is a function that does not return a value called?
Signup and view all the answers
What does passing an object ByVal do?
What does passing an object ByVal do?
Signup and view all the answers
What does the keyword 'Function' represent in Visual Basic (VB)?
What does the keyword 'Function' represent in Visual Basic (VB)?
Signup and view all the answers
What is the default data type for parameters in Visual Basic (VB) if not specified?
What is the default data type for parameters in Visual Basic (VB) if not specified?
Signup and view all the answers
In PL/I, what information can be provided by a descriptor when passing arguments to a procedure?
In PL/I, what information can be provided by a descriptor when passing arguments to a procedure?
Signup and view all the answers
What does the Sub keyword signify in relation to returning values in Visual Basic (VB)?
What does the Sub keyword signify in relation to returning values in Visual Basic (VB)?
Signup and view all the answers
What does the ampersand (&) signify when used in a function call like addTwo(&v)?
What does the ampersand (&) signify when used in a function call like addTwo(&v)?
Signup and view all the answers
What characteristic distinguishes a free function from a member function in C++?
What characteristic distinguishes a free function from a member function in C++?
Signup and view all the answers
What concept does the procedure represent in Visual Basic (VB) when used in a class?
What concept does the procedure represent in Visual Basic (VB) when used in a class?
Signup and view all the answers
Study Notes
Subroutines and Functions
- In early BASIC variants, GOSUB allows a program to jump to a subroutine and return to the original location when the subroutine is finished.
ByRef Argument Passing
- When an argument is passed ByRef, a reference to the original variable is passed, allowing the called procedure to modify the original variable.
Microsoft Small Basic
- In Microsoft Small Basic, the keyword
Sub
is used to denote the start of a subroutine.
C and C++
- In C and C++, a function that does not return a value is called a void function.
ByVal Argument Passing
- When an object is passed ByVal, a copy of the object is passed, and any changes to the copy do not affect the original object.
Visual Basic (VB)
- The
Function
keyword represents a block of code that returns a value. - The default data type for parameters in Visual Basic (VB) is
Variant
if not specified. - The
Sub
keyword signifies that a subroutine does not return a value.
PL/I
- A descriptor can provide information about the data type, length, and other attributes of an argument when passing arguments to a procedure.
C++ Function Calls
- The ampersand (&) signifies that a reference to a variable is being passed to a function, such as
addTwo(&v)
.
C++ Function Types
- A free function is a function that is not a member of a class, distinguishing it from a member function.
Visual Basic (VB) Classes
- A procedure represents a method or action that can be performed by an object when used in a class.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about the GOSUB command in early BASIC variants, which allows control to jump to a specified line number in the code, execute a subroutine, and then resume execution at the next line. Explore how this feature influenced programming styles in early BASIC implementations.