Qbasicnews.com

Full Version: Subprograms
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there

I read a tutorial that said "By definition, a function is a subprogram designed to perform a specific task and return a value" ,the tutorial was about QBasic.

Quetsion 1: Is the statement correct?

Question 2: With regards to SubPrograms in QBasic, are Functions Subprograms or are Sub Procedures Subprograms? Or can they both be classified as Subprograms.
1.- Yes

2.- SUBs are computer science's "Procedures". Some kind (but not the same) of C's void functions.
Procedure now really means the same thing as function. At least in Java and C#.
Quote:Procedure now really means the same thing as function. At least in Java and C#.

Technically, Java and C# have methods, not procedures or functions. This is because both languages are (close to) pure object orientation. All methods in a Java or C# program must act on an instance of an object.
Quote:
PlayGGY Wrote:Procedure now really means the same thing as function. At least in Java and C#.

Technically, Java and C# have methods, not procedures or functions. This is because both languages are (close to) pure object orientation. All methods in a Java or C# program must act on an instance of an object.

Yes, that is what I was thinking of. You are right.
In our VB class, this kind of thing should be taught...but it is not. And it really sucks coz none of the students except Rhiannon (of course, coz I can teach her on our free time) are "getting it".