Introduction to Procedural Programming - Part I

Writing Procedural Programs in QBASIC is simple. First lets understand what do you mean by procedural programs, what is benefit of it, why is it necessary in programming, its significance and how to all will be discussed in brief. You need to follow futher in the school text book. If anything like to know more from me please write to me.
Lets start.
Procedural word comes from procedure that means "set of steps to carryout some task". Ofcourse procedural programming is a such a tactics (approach) of write programs where we will divide our whole problem (program) manageably into many procedures that will be invoked (called) at the time of need in program to perform task as per required.
From above you might notice there are two aspects (components) in the procedural programming (programs) that are: (i) calling program and (ii) called program
Lets be clear about these two aspects first.
(i) What is calling program?
-> Basically the module program or sometime procedure (sub-program) itself may call another sub-program (procedure) or say pass control to it, such program is called calling program. Subroutines are called using optional statement "Call" and functions are invoked simply by using the function name either with "Print statement" or Assignment (Optional LET statement).
In other word we can also say that program from where subroutine is called or function is invoked is regarded as "Calling Program".
(ii) What is called program?
-> The subroutine or function (also say sub-program/procedure) that is called or invoked are regarded as "Called Program". Subroutine is enclosed within SUB...END SUB statements and Function is enclosed within FUNCTION...END FUNCTION statement. One more point to be noted that there is another kind of user defined function as well which resides in the module only cannot be allocated as seperate procedure that is DEF  FN... END DEF statement.

In the next post I will distinguish between SUB and FUNCTION and FUNCTION and DEF FN.
Before please check your text book to get into futher topics. It will be very helpful to understand futher.

Be patient and revise again and again to you can grab the discussions here.

Good Luck.
Have a fun. Enjoy your time with your friends.

No comments:

Post a Comment