home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / FOXPRO / FFAQ / FORCE.FAQ < prev    next >
Text File  |  1992-08-17  |  15KB  |  420 lines

  1.     FORCE FAQ (Frequently Asked Questions)   (FORCE.FAQ 1.3)           1
  2.     --------------------------------------------------------------------
  3.  
  4.     Topic:   FREQUENTLY ASKED QUESTIONS             Author: David Holmes
  5.  
  6.     What you'll find here:
  7.  
  8.         ( ) General discussion and easy FAQ answers
  9.         ( ) Technical question answers
  10.  
  11.     Supporting Files:
  12.         ( ) Inter_C.FAQ -- FAQ's for mixing FORCE and C
  13.         ( ) Inter_A.FAQ -- FAQ's for mixing FORCE and Assembler
  14.         ( ) Alloc.FAQ   -- FAQ for FORCE dynamic memory allocation
  15.         ( ) XMS.FAQ     -- Interfacing with XMS memory
  16.         ( ) UNDOC.FAQ   -- Undocumented FORCE functions
  17.  
  18.     General Discussion
  19.     --------------------------------------------------------------------
  20.     Before we start talking about the techical aspects of FORCE, let's
  21.     cover the ``other'' questions first.
  22.  
  23.     Q:    What's the most current version of FORCE?
  24.  
  25.     A:    We're currently shipping 2.1E.
  26.  
  27.     Q:    When's the next revision of FORCE due out?
  28.  
  29.     A:    The next version of FORCE is 2.5, and is schedule for
  30.     release in the fourth quarter of this year.  The call for 
  31.     Beta testers will go out on the September 1st on the BBS and
  32.     in the FORCE area of PCVENF on Compuserve.  The features that
  33.     will be included in 2.5 are:
  34.  
  35.     Enhanced Index Support - NDX, IDX, NTX, MDX, CDX (maybe), FDX
  36.     Bug Fixes - For all bugs that we know about (see the buglist)
  37.     Smaller TSR's
  38.     More functions for UI features.
  39.  
  40.     Q:    How about a revised manual?
  41.  
  42.     A:    The new manual will appear concurrently with the next
  43.     version of Force (see above). In the meantime, check out
  44.     "The illustrated FORCE 2" from WordWare's Robert Granillo
  45.     (who also does the "Illustrated FoxPro").  It's a steal at
  46.     $24.95, and you can get a copy from WordWare direct at
  47.     800-229-4949.  International callers may call 214-423-0090.
  48.  
  49.     Q:    Is there an official FORCE Buglist?
  50.  
  51.     A:    Yes, it's called BUGLIST.21E and you can find the latest
  52.     copy in Area 2 or with this file if you downloaded it as a .ZIP.
  53.     If you have any bugs that you'd like to submit that aren't
  54.     in the list (and you have to be sure its a bug), contact
  55.     me (David Holmes), as I'm the current archiver of bugs and
  56.     frequently asked questions.  BUGLIST.21E will be updated as new
  57.     information comes in, and the date of the last revision will be
  58.     part of the file description.
  59.     --------------------------------------------------------------------
  60.                                                                        1
  61.     FORCE FAQ (Frequently Asked Questions)                             2
  62.     --------------------------------------------------------------------
  63.     Q:    How about a third party library list for FORCE?
  64.  
  65.     A:    You got it.  Here are the ones that we know about and have
  66.     kept in touch with:
  67.  
  68.     JEFF DAVIS LIBRARY FOR FORCE:
  69.         Extended function library for FORCE with over 500+
  70.         functions including relative windows & mouse support
  71.     JEFF DAVIS COMMUNICATIONS LIBRARY FOR FORCE:
  72.         Exactly what you'd think.
  73.         contact:    Jeff Davis
  74.                 (303) 444-4047
  75.                 650 Mountain Meadows
  76.                 Boulder, CO 80302
  77.     DFORCE
  78.         Extended function library, 700+ functions
  79.         contact:    SoftMagic
  80.                 Albert Alexander Bukoski
  81.                 P.O.  27909
  82.                 San Diego, CA 92198
  83.     TELETOOLS PLUS
  84.         Communications library for FORCE
  85.         contact:    JSoft (307) 637-3152
  86.                 105 Rio Verde Circle
  87.                 Cheyenne, WY 82001
  88.  
  89.     SPECIAL FORCES
  90.         Graphics function library for FORCE
  91.         contact:    Special Forces
  92.                 404 Dove Court
  93.                 Mt. Holly, N.J. 08060
  94.  
  95.     CHESHIRE CAT
  96.         FORCE Debugger (UK)
  97.  
  98.     BLINKER v 2.0
  99.         Advanced overlay linker; support FORCE objects
  100.         contact:    Blink, Inc. (804)-355-4444
  101.                 P.O. Box 7154
  102.                 Richmond, VA 23221
  103.  
  104.  
  105.     Undocumented Error Messages
  106.     -----------------------------------------------------------------
  107.     Q:    When I run my program, I keep getting error #318!
  108.         Where the hell does it say anything about error #318?
  109.  
  110.     A:    Well, nowhere, until now.  Here's what you need to know
  111.     about FORCE error messages:
  112.  
  113.     When you get a FORCE run-time error, use the perror program to
  114.     get a quick description of the error.
  115.  
  116.     All run-time errors with a number less than 256 are DOS error
  117.     Messages.  For example, error #6 should be "invalide handle"
  118.     under ANY DOS compiler (one would hope).  Therefore, if you have
  119.  
  120.     --------------------------------------------------------------------
  121.                                                                        2
  122.     FORCE FAQ (Frequently Asked Questions)                             3
  123.     --------------------------------------------------------------------
  124.     a good DOS reference, check out the DOS error messages and what
  125.     they mean.  If not, I'm providing a quick reference for DOS
  126.     error Messages that FORCE knows about below.
  127.  
  128.         Error  1    Invalid DOS function.
  129.         Error  2    File not found.
  130.         Error  3    Path not found.
  131.         Error  4    Too many files open.
  132.         Error  5    Access denied.
  133.         Error  6    Invalid handle.
  134.         Error  7    Memory control blocks destroyed.
  135.         Error  8    Insufficient memory.
  136.         Error  9    Memory block address invalid.
  137.         Error 10    Invalid environment.
  138.         Error 11    Invalid format.
  139.         Error 12    Invalid access code.
  140.         Error 13    Invalid data.
  141.         Error 14    Invalid drive.
  142.         Error 15    Attempt to remove the current directory.
  143.         Error 16    Not the same device.
  144.         Error 17    No more files.
  145.         Error 18    Disk is write protected.
  146.         Error 19    Bad disk unit.
  147.         Error 20    Drive is not ready.
  148.         Error 21    Invalid disk command.
  149.         Error 22    CRC error.
  150.         Error 23    Invalid length.
  151.         Error 24    Seek error.
  152.         Error 25    Not an msdos disk.
  153.         Error 26    Sector not found.
  154.         Error 27    Out of paper.
  155.         Error 28    Write fault.
  156.         Error 29    Read fault.
  157.         Error 30    General failure.
  158.         Error 31    Sharing violation.
  159.         Error 32    Lock violation.
  160.         Error 33    Wrong disk.
  161.         Error 34    FCB unavailable.
  162.  
  163.     The FORCE manual lists several error numbers that say things like
  164.     "Internal error: Please contact Technical Support."  Here's what
  165.     they really mean:
  166.  
  167.     Error 263:    Call back table full
  168.         Usually happens on a QUIT command, as FORCE calls back all
  169.         the functions that opened files and indexes and databases.
  170.         If you get this error, reduce the number of files and
  171.         indexes and databases that you have open when the QUIT
  172.         command is executed.
  173.  
  174.     Error 318:    Run Installed a TSR Program
  175.         This one isn't even in the manual, but it's message is
  176.         pretty self-explanatory.  You must have executed RUN
  177.         command that installed a TSR (like the dos PRINT program,
  178.         for example).
  179.  
  180.     --------------------------------------------------------------------
  181.                                                                        3
  182.     FORCE FAQ (Frequently Asked Questions)                             4
  183.     --------------------------------------------------------------------
  184.  
  185.     The following compile-time errors (all in the 7000 level) are caused
  186.     by bugs in the compiler.  You shouldn't see these very often.
  187.     (we hope).
  188.  
  189.     Error 7000:    Set Internal SEGMENT block
  190.         If you get this error, you probably have too many functions
  191.         in one module.  Split them up into different modules until
  192.         you no longer get this error.
  193.  
  194.     Error 7005:    Invalide Opcode table
  195.         People used to get this error when FORCE was VERY new, and
  196.         was generating opcodes that the computer doesn't understand.
  197.         The solution at the time was to get a newer version of
  198.         FORCE, which fixed the problem.  You just shouldn't get this
  199.         error any more, and if you do "please contact technical
  200.         support."
  201.  
  202.     Error 7010:    Register not deallocated
  203.         This error occurs when FORCE wants to use a register, say,
  204.         CX, but is already using it for something else.  Go figure.
  205.         This error usually happens when you're doing some
  206.         expression like
  207.  
  208.             x = abs( (3 * &PI/4) * x**(z/q0) ) * x + 42 * y.
  209.  
  210.         If that's the case, then break up the expression into
  211.         smaller parts until you no longer get this error.
  212.  
  213.     Error 7015:    Stack not cleaned up properly
  214.         This error happens if FORCE decides not to clean up the
  215.         stack. Like error #7005, you just shouldn't get this one.
  216.  
  217.     Error 7020:    Too many sub-modules
  218.         What it really means is that you have too many nested
  219.         #include statements.  Figure out a different way to
  220.         #include your headers.  One way to do it is:
  221.  
  222.         **--
  223.         **-- JimBob.hdr -- Stuff I need
  224.         **--
  225.  
  226.         #ifndef JIMBOB_HDR
  227.         #define JIMBOB_HDR
  228.  
  229.         #define FALSE .f.
  230.         #define TRUE  .t.
  231.  
  232.         #define PI 3.14159256358
  233.  
  234.         #endif            && JIMBOB_HDR
  235.  
  236.         which will make sure that your include files don't get
  237.         multiply #include'd.
  238.  
  239.     --------------------------------------------------------------------
  240.                                                                        4
  241.     FORCE FAQ (Frequently Asked Questions)                             5
  242.     --------------------------------------------------------------------
  243.  
  244.     Error 7025:    Segment Full
  245.         This could be either your global data segment, or any code
  246.         segment.  Your global data segment has things like your
  247.         global VARDEF, any DBFDEF, INDEXDEF, and LABELDEF's.
  248.         Pretty much any data that resides outside of a function is
  249.         put in the global data segment.  If you think that your
  250.         data segment is full, then try to use more local variables.
  251.  
  252.         Each procedure gets its own CODE segment, so you'd have to
  253.         have something like a 10,000 line procedure to fill it up.
  254.         If this is the case, I hope you recover soon.  The obvious
  255.         solution is to split up your 10,000 line procedure into
  256.         other procedures (this is known as divide and conquer, for
  257.         you novice programmers with 10,000 line procedures out there).
  258.  
  259.     Error 7030:    Expression Stack
  260.         This happens when you have an expression that is just too
  261.         complex for FORCE to swallow all at once.  Break it up into
  262.         smaller parts.
  263.  
  264.     There are two more 'Internal' errors that I haven't covered,
  265.     but I'll try to get to them in the next edition of the FAQ.
  266.  
  267.     Optimizing your Code
  268.     -----------------------------------------------------------------
  269.     FORCE generates the tightest, fastest code of all the Xbase
  270.     compilers that I've seen.  But, if your executable isn't just
  271.     quite small enough for you, here are some tips:
  272.  
  273.     Specify all string lengths in your global VARDEF
  274.         If you don't the string will take up 255 characters of space.
  275.  
  276.     Turn off stack checking (the /n option)
  277.         This will save you about %1 of space, and probably an equal
  278.         amount of run-time.
  279.  
  280.     Watch out for DATA.HDR.  If just #include it, you add an
  281.     automatic 22K to your program.  The actual perpetrators of this
  282.     crime are the variables __exit_status, which adds ~3K, and
  283.     __field_eof, which adds the other ~19K.  So, if you've been
  284.     using DATA.HDR for __color_std & __color_enhcd, then you should
  285.     think about not including data.hdr, and just putting the
  286.     variables in your own VARDEF EXTERN.
  287.  
  288.     Another memory-hogging header file is MEMO.HDR, which will add
  289.     about ~25K to your executable.  However, there's not much you
  290.     can do about it if you use the MEMO functions.  The good news
  291.     is that a lot of the functions included when you #include DATA.HDR
  292.     AND MEMO.HDR are the same, so you end up with a net gain of only
  293.     (only?) ~28K.
  294.  
  295.     This probably applies to some other headers, but I'm pretty sure that
  296.     data.hdr is the worst.
  297.  
  298.  
  299.     --------------------------------------------------------------------
  300.                                                                        5
  301.     FORCE FAQ (Frequently Asked Questions)                             6
  302.     --------------------------------------------------------------------
  303.  
  304.     Debugging Tip
  305.     -----------------------------------------------------------------
  306.     Most FORCE functions usually push 14 bytes of data on the stack
  307.     when they're called.  They save BP, ES, DI, DS, and SI.  Each of
  308.     those register values are 2 bytes (or 1 word), making 10 bytes
  309.     total.
  310.  
  311.     Knowing this, you can look at your local variables by examining
  312.     the stack, because that's where FORCE allocates all of its local
  313.     memory from.  For example, if you have a function that looks like:
  314.  
  315.     PROCEDURE Mr_Function
  316.         VARDEF
  317.             int                x
  318.             int                y
  319.         ENDDEF
  320.  
  321.     X is going to be at SS:[BP - 10d], (or SS:[BP - 0ah] in hex),
  322.     and Y is going to be at SS:[BP - 12d]
  323.     If you use SYMDEB as your debugger, you can just type
  324.     -e ss:bp-a
  325.     and it'll show you the value of X.  If this information is going
  326.     to be of any use to you, you need to know the byte lengths of
  327.     the FORCE data types, so here they are:
  328.  
  329.     BYTE            1
  330.     INT, UNIT        2
  331.     LONG, ULONG        4
  332.     LOGICAL            2
  333.     DBL            8
  334.  
  335.     Just remember that CHAR strings are also allocated from the stack,
  336.     and are of their specified length or 255 otherwise.
  337.  
  338.     Technical Questions
  339.     -----------------------------------------------------------------
  340.     Q:    I keep getting a fixup error at Q_MEMORY.ASM when I link
  341.     my FORCE code with Borland's Turbo Link.  Why?
  342.  
  343.     A:    FORCE code suddenly became imcompatible with Borland
  344.     products when Borland came out with TURBO C++.  At that time,
  345.     they introduced TURBO LINK 3.0 (TLINK).  TLINK versions 3.0 and
  346.     up do not work with FORCE at all, nor do the Borland C++ compilers
  347.     work (at least, I haven't been able to get them to work, and as
  348.     I understand it, the entire compiler and its library will have to
  349.     be rewritten if we want to stay compatible with Borland).  The
  350.     incompatibility was caused when Borland decided to change the
  351.     structure of its OBJ files.  Either we have to meet their
  352.     structure requirements, or hope that they create a compiler
  353.     switch which supports true Intel/Microsoft OBJ structure.
  354.     However, considering Borland's competitive stance with regards
  355.     to Microsoft....
  356.  
  357.  
  358.  
  359.     ------------------------------------------------------------------
  360.                                                                      6
  361.     FORCE FAQ (Frequently Asked Questions)                           7
  362.     ------------------------------------------------------------------
  363.  
  364.     So, TLINK version 2.0, and probably all versions of MicroSoft's
  365.     LINK will work okay.  We suggest that you use the MS link if you
  366.     have it.  It may be a little slower than TLINK, but we know it
  367.     works.
  368.  
  369.     See the file INTER_C for further discussion on C and FORCE here in
  370.     Area 12.
  371.  
  372.     Q:    All of my FORCE TSR's are taking up 80k+ of memory.  Is
  373.     there anything I can do to cut that down?
  374.  
  375.     A:    Not really.  FORCE TSR's were built to be bullet proof,
  376.     allowing them to be called in almost any situation.  However,
  377.     that's a lot of ground to cover, hence the inordinately large
  378.     memory sizes.  We have considered this carefully, and we've
  379.     decided that a solution would be impractical until the next
  380.     revision.  The next version will feature better dynamic memory
  381.     management which in turn will allow TSRs to be much more frugal
  382.     with regards to their memory usage.
  383.  
  384.     ---------------------------------------------------------------
  385.     That's all for the moment folks (keep in mind these are
  386.     FREQUENTLY asked, and I do mean FREQUENTLY).  I must have
  387.     answered that one about Tlink at least 3 dozen times in the
  388.     last two years...
  389.  
  390.     If you have any suggestions for topics to be covered here in
  391.     the FAQ area (Area 12), please let me know.  Just send a message
  392.     to me, David Holmes.
  393.  
  394.     Keep checking the FAQ periodically.  The file description
  395.     line will give the date of the latest revision.
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.     --------------------------------------------------------------------
  420.