Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>modifying the rlib library</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Modifying The RLIB Library

   You may want to custom tailor some of the functions in RLIB to meet
   your own needs.  Since the source code is provided for RLIB, this
   capability is what makes RLIB so versatile.  All you need is, of
   course, a copy of Clipper and a library manager program such as LIB
   from Microsoft.  Included with this package is a make file named
   RLIB.MAK which can be used to maintain the library.  See the
   discussion of how to use a library manager in the documentation that
   comes with the package you use.


   Clipper Summer '87

   When writing a collection of functions to build into a library, the
   biggest difference between Clipper compiled functions and functions
   written in other languages is that Clipper uses the filename to
   generate the public symbol that will be placed in the resulting object
   file.  If you write a program named TEST.PRG and compile it with
   Clipper, the resulting object file is named TEST.OBJ and the public
   symbol in that object file (the function name that you call) is named
   TEST.  That's ok if TEST.PRG does something useful, but if all
   TEST.PRG does is to contain a function named TEST, then Clipper will
   give you a SYMBOL REDEFINITION ERROR.  This is because Clipper is
   trying to create two symbols for the linker, both with the same name;
   one named TEST for the .PRG file program itself, and the other for the
   function named TEST contained in that .PRG file.

   For this reason, .PRG files that contain nothing but a function must
   have a name different from the function name itself.  Therefore, all
   the RLIB functions are contained in .PRG files starting with "RL_" and
   ending with the first 5 letters of the function name.  Of course you
   could get around this by having one .PRG file named RLIB.PRG with all
   of the functions separately listed within it, but this nullifies the
   advantage of using a library.  If you did it that way, all of the code
   would be linked into your application whether you called all the
   functions within it or not.  Having the functions contained in a
   library is handy because only those functions you use are extracted
   and included in your .EXE file when linked.


   Clipper 5.0

   Clipper 5.0 has resolved this issue with the addition of the /N
   compile switch.  The purpose of this new switch is to suppress the
   definition of a procedure with the same name as the .PRG file.  This
   definition of a procedure creates an entry point to the program file
   on the first non-comment line of the source file.  The /N switch
   forces the compiler to not create this entry point and thereby not
   create a public symbol with the same name as the program file.  What
   this all means is that in Clipper 5.0 you can have a source file named
   BOXMENU.PRG with only one function in it named BOXMENU and Clipper
   will not complain if you compile this with the /N compiler command
   line switch.

   For consistency, the 5.0 versions of the RLIB source code have the
   same source file names as the Summer '87 versions, that is, they all
   are prefaced with RL_.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson