
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FORCE Data Base Compiler - ##############################################################################
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+--------------+###########################################################
#+-| SETUP_TURBOC |-----------------------------------+#######################
#| +--------------+ Allow FORCE programs to link with |#######################
#| TurboC runtime and graphic libs |#######################
#+----------------------------------------------------+#######################
##############################################################################
##############################################################################
#+--| Summary |---------------+###############################################
#| #INCLUDE mixed.hdr |###############################################
#+----------------------------+###############################################
##############################################################################
##############################################################################
#+--| Syntax |------------------------------+#################################
#| PROCEDURE setup_turboc PROTOTYPE |#################################
#+------------------------------------------+#################################
##############################################################################
##############################################################################
#########+---| Description |----------------------------------------+#########
#########| This procedure allows a FORCE program to link directly |#########
#########| with the Borland TurboC runtime and graphics library, or |#########
#########| any library specific to Borland's TurboC compiler. |#########
#########| -------------------------------------------------------- |#########
#########| The procedure must be called prior to using any TurboC |#########
#########| library routines. It is best to call setup_turboc at the |#########
#########| start of your program, within the procedure force_main. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
##########+---| Design |-------------------------------------------+##########
##########| The setup_turboc procedure emulates Borland's startup |##########
##########| modules for their C libraries, i.e., cl.obj. an array |##########
##########| is established for the command line allowing the |##########
##########| usage of the C library argv() and argc() functions. |##########
##########| Also, the DOS environment is copied to an internal |##########
##########| buffer. |##########
##########| ------------------------------------------------------ |##########
##########| The link order is important with TurboC libraries. |##########
##########| The force.lib file must appear BEFORE any TurboC |##########
##########| libraries and if you are using the Borland math |##########
##########| emulation library emu.lib, it must appear before the |##########
##########| cl.lib or math.lib libraries in the link line. |##########
##########| for example, |##########
##########| |##########
##########| link forceapp ,,, force emu cl mathl |##########
##########| |##########
##########| Because FORCE's memory module is large, use only large |##########
##########| model libraries. |##########
##########| ------------------------------------------------------ |##########
##########| The source to setup_turboc is distributed on the FORCE |##########
##########| diskettes. A sample application using TurboC graphics |##########
##########| library, ftoc.prg, is also included. |##########
##########+--------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Call setup_turboc at the start of your program |#########
#########| * within the procedure force_main. |#########
#########| |#########
#########| #include mixed.hdr |#########
#########| PROCEDURE force_main |#########
#########| |#########
#########| DO setup_turboc |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Use the 'biosmemory' function in the TurboC |#########
#########| * function library. biosmemory function is |#########
#########| * described in the TurboC reference guide. |#########
#########| |#########
#########| #include mixed.hdr |#########
#########| |#########
#########| FUNCTION INT biosmemory PROTOTYPE |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| |#########
#########| DO setup_turboc |#########
#########| ? "System memory: " + biosmemory() |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also: setup_micro
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson