Hey there! We receieved your request
Stay Tuned as we are going to contact you within 1 Hour
One of our academic counsellors will contact you within 1 working day.
Click to Chat
1800-5470-145
+91 7353221155
Use Coupon: CART20 and get 20% off on all online Study Material
Complete Your Registration (Step 2 of 2 )
Sit and relax as our customer representative will contact you within 1 business day
OTP to be sent to Change
What is modular programming??
Modular programming can be used to break up a large program into manageable units, or to create code that can be easily re-used. A modular program consists of a main module and one or more auxiliary modules. Each module originates from a separate source code file. The main module is compiled as an EXE, and calls functions in the auxiliary modules. The auxiliary modules can be dynamically linked, meaning they exist as separate executable files (DLLs) which are loaded when the main EXE is run; or they can be statically linked, meaning they are compiled as object files or static libraries (LIBs) that are combined with the main module into a single executable file. Once you have learned how to create an executable file from an XBasic source program, it is easy to extend the procedure to make dynamically linked modules and (a little less easily) statically linked modules. There are, however, a few rules that must be followed when writing the source code for the auxiliary modules.
Each module must have a unique name, assigned in the PROGRAM statement. This name must be the same as the file name of the source code, minus the .x extension. For example, the source code auxiliary.x must have the statement PROGRAM "auxiliary" in the PROLOG. (The standard PROLOG code contains the comment that the program name must have 1 to 8 characters, but names longer than this seem to work without any problem. However, the name cannot contain spaces.)
Function names need to be unique across all modules (with the exception of INTERNAL FUNCTIONs). This includes the Entry() function, which will need to be renamed in each auxiliary module. After re-naming the Entry() function, be sure to edit the PROLOG so that the new name is the first declared function. See below for more notes on the Entry function.
All functions, composite types, and global constants that will be used by the main module (or by another auxiliary module) must be exported - ie., enclosed in an EXPORT...END EXPORT block in the PROLOG.
EXTERNAL variables can be used in statically linked modules, but not in DLLs. Such variables are shared only within a single executable module, and since all statically linked modules are combined with the main module into a single EXE, EXTERNAL variables can be shared between them. A DLL remains separate from other modules, and does not share EXTERNAL variables with them.
Get your questions answered by the expert for free
You will get reply from our expert in sometime.
We will notify you when Our expert answers your question. To View your Question
Win Gift vouchers upto Rs 500/-
Register Yourself for a FREE Demo Class by Top IITians & Medical Experts Today !