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 >
Wrap
Text File
|
1992-08-17
|
15KB
|
420 lines
FORCE FAQ (Frequently Asked Questions) (FORCE.FAQ 1.3) 1
--------------------------------------------------------------------
Topic: FREQUENTLY ASKED QUESTIONS Author: David Holmes
What you'll find here:
( ) General discussion and easy FAQ answers
( ) Technical question answers
Supporting Files:
( ) Inter_C.FAQ -- FAQ's for mixing FORCE and C
( ) Inter_A.FAQ -- FAQ's for mixing FORCE and Assembler
( ) Alloc.FAQ -- FAQ for FORCE dynamic memory allocation
( ) XMS.FAQ -- Interfacing with XMS memory
( ) UNDOC.FAQ -- Undocumented FORCE functions
General Discussion
--------------------------------------------------------------------
Before we start talking about the techical aspects of FORCE, let's
cover the ``other'' questions first.
Q: What's the most current version of FORCE?
A: We're currently shipping 2.1E.
Q: When's the next revision of FORCE due out?
A: The next version of FORCE is 2.5, and is schedule for
release in the fourth quarter of this year. The call for
Beta testers will go out on the September 1st on the BBS and
in the FORCE area of PCVENF on Compuserve. The features that
will be included in 2.5 are:
Enhanced Index Support - NDX, IDX, NTX, MDX, CDX (maybe), FDX
Bug Fixes - For all bugs that we know about (see the buglist)
Smaller TSR's
More functions for UI features.
Q: How about a revised manual?
A: The new manual will appear concurrently with the next
version of Force (see above). In the meantime, check out
"The illustrated FORCE 2" from WordWare's Robert Granillo
(who also does the "Illustrated FoxPro"). It's a steal at
$24.95, and you can get a copy from WordWare direct at
800-229-4949. International callers may call 214-423-0090.
Q: Is there an official FORCE Buglist?
A: Yes, it's called BUGLIST.21E and you can find the latest
copy in Area 2 or with this file if you downloaded it as a .ZIP.
If you have any bugs that you'd like to submit that aren't
in the list (and you have to be sure its a bug), contact
me (David Holmes), as I'm the current archiver of bugs and
frequently asked questions. BUGLIST.21E will be updated as new
information comes in, and the date of the last revision will be
part of the file description.
--------------------------------------------------------------------
1
FORCE FAQ (Frequently Asked Questions) 2
--------------------------------------------------------------------
Q: How about a third party library list for FORCE?
A: You got it. Here are the ones that we know about and have
kept in touch with:
JEFF DAVIS LIBRARY FOR FORCE:
Extended function library for FORCE with over 500+
functions including relative windows & mouse support
JEFF DAVIS COMMUNICATIONS LIBRARY FOR FORCE:
Exactly what you'd think.
contact: Jeff Davis
(303) 444-4047
650 Mountain Meadows
Boulder, CO 80302
DFORCE
Extended function library, 700+ functions
contact: SoftMagic
Albert Alexander Bukoski
P.O. 27909
San Diego, CA 92198
TELETOOLS PLUS
Communications library for FORCE
contact: JSoft (307) 637-3152
105 Rio Verde Circle
Cheyenne, WY 82001
SPECIAL FORCES
Graphics function library for FORCE
contact: Special Forces
404 Dove Court
Mt. Holly, N.J. 08060
CHESHIRE CAT
FORCE Debugger (UK)
BLINKER v 2.0
Advanced overlay linker; support FORCE objects
contact: Blink, Inc. (804)-355-4444
P.O. Box 7154
Richmond, VA 23221
Undocumented Error Messages
-----------------------------------------------------------------
Q: When I run my program, I keep getting error #318!
Where the hell does it say anything about error #318?
A: Well, nowhere, until now. Here's what you need to know
about FORCE error messages:
When you get a FORCE run-time error, use the perror program to
get a quick description of the error.
All run-time errors with a number less than 256 are DOS error
Messages. For example, error #6 should be "invalide handle"
under ANY DOS compiler (one would hope). Therefore, if you have
--------------------------------------------------------------------
2
FORCE FAQ (Frequently Asked Questions) 3
--------------------------------------------------------------------
a good DOS reference, check out the DOS error messages and what
they mean. If not, I'm providing a quick reference for DOS
error Messages that FORCE knows about below.
Error 1 Invalid DOS function.
Error 2 File not found.
Error 3 Path not found.
Error 4 Too many files open.
Error 5 Access denied.
Error 6 Invalid handle.
Error 7 Memory control blocks destroyed.
Error 8 Insufficient memory.
Error 9 Memory block address invalid.
Error 10 Invalid environment.
Error 11 Invalid format.
Error 12 Invalid access code.
Error 13 Invalid data.
Error 14 Invalid drive.
Error 15 Attempt to remove the current directory.
Error 16 Not the same device.
Error 17 No more files.
Error 18 Disk is write protected.
Error 19 Bad disk unit.
Error 20 Drive is not ready.
Error 21 Invalid disk command.
Error 22 CRC error.
Error 23 Invalid length.
Error 24 Seek error.
Error 25 Not an msdos disk.
Error 26 Sector not found.
Error 27 Out of paper.
Error 28 Write fault.
Error 29 Read fault.
Error 30 General failure.
Error 31 Sharing violation.
Error 32 Lock violation.
Error 33 Wrong disk.
Error 34 FCB unavailable.
The FORCE manual lists several error numbers that say things like
"Internal error: Please contact Technical Support." Here's what
they really mean:
Error 263: Call back table full
Usually happens on a QUIT command, as FORCE calls back all
the functions that opened files and indexes and databases.
If you get this error, reduce the number of files and
indexes and databases that you have open when the QUIT
command is executed.
Error 318: Run Installed a TSR Program
This one isn't even in the manual, but it's message is
pretty self-explanatory. You must have executed RUN
command that installed a TSR (like the dos PRINT program,
for example).
--------------------------------------------------------------------
3
FORCE FAQ (Frequently Asked Questions) 4
--------------------------------------------------------------------
The following compile-time errors (all in the 7000 level) are caused
by bugs in the compiler. You shouldn't see these very often.
(we hope).
Error 7000: Set Internal SEGMENT block
If you get this error, you probably have too many functions
in one module. Split them up into different modules until
you no longer get this error.
Error 7005: Invalide Opcode table
People used to get this error when FORCE was VERY new, and
was generating opcodes that the computer doesn't understand.
The solution at the time was to get a newer version of
FORCE, which fixed the problem. You just shouldn't get this
error any more, and if you do "please contact technical
support."
Error 7010: Register not deallocated
This error occurs when FORCE wants to use a register, say,
CX, but is already using it for something else. Go figure.
This error usually happens when you're doing some
expression like
x = abs( (3 * &PI/4) * x**(z/q0) ) * x + 42 * y.
If that's the case, then break up the expression into
smaller parts until you no longer get this error.
Error 7015: Stack not cleaned up properly
This error happens if FORCE decides not to clean up the
stack. Like error #7005, you just shouldn't get this one.
Error 7020: Too many sub-modules
What it really means is that you have too many nested
#include statements. Figure out a different way to
#include your headers. One way to do it is:
**--
**-- JimBob.hdr -- Stuff I need
**--
#ifndef JIMBOB_HDR
#define JIMBOB_HDR
#define FALSE .f.
#define TRUE .t.
#define PI 3.14159256358
#endif && JIMBOB_HDR
which will make sure that your include files don't get
multiply #include'd.
--------------------------------------------------------------------
4
FORCE FAQ (Frequently Asked Questions) 5
--------------------------------------------------------------------
Error 7025: Segment Full
This could be either your global data segment, or any code
segment. Your global data segment has things like your
global VARDEF, any DBFDEF, INDEXDEF, and LABELDEF's.
Pretty much any data that resides outside of a function is
put in the global data segment. If you think that your
data segment is full, then try to use more local variables.
Each procedure gets its own CODE segment, so you'd have to
have something like a 10,000 line procedure to fill it up.
If this is the case, I hope you recover soon. The obvious
solution is to split up your 10,000 line procedure into
other procedures (this is known as divide and conquer, for
you novice programmers with 10,000 line procedures out there).
Error 7030: Expression Stack
This happens when you have an expression that is just too
complex for FORCE to swallow all at once. Break it up into
smaller parts.
There are two more 'Internal' errors that I haven't covered,
but I'll try to get to them in the next edition of the FAQ.
Optimizing your Code
-----------------------------------------------------------------
FORCE generates the tightest, fastest code of all the Xbase
compilers that I've seen. But, if your executable isn't just
quite small enough for you, here are some tips:
Specify all string lengths in your global VARDEF
If you don't the string will take up 255 characters of space.
Turn off stack checking (the /n option)
This will save you about %1 of space, and probably an equal
amount of run-time.
Watch out for DATA.HDR. If just #include it, you add an
automatic 22K to your program. The actual perpetrators of this
crime are the variables __exit_status, which adds ~3K, and
__field_eof, which adds the other ~19K. So, if you've been
using DATA.HDR for __color_std & __color_enhcd, then you should
think about not including data.hdr, and just putting the
variables in your own VARDEF EXTERN.
Another memory-hogging header file is MEMO.HDR, which will add
about ~25K to your executable. However, there's not much you
can do about it if you use the MEMO functions. The good news
is that a lot of the functions included when you #include DATA.HDR
AND MEMO.HDR are the same, so you end up with a net gain of only
(only?) ~28K.
This probably applies to some other headers, but I'm pretty sure that
data.hdr is the worst.
--------------------------------------------------------------------
5
FORCE FAQ (Frequently Asked Questions) 6
--------------------------------------------------------------------
Debugging Tip
-----------------------------------------------------------------
Most FORCE functions usually push 14 bytes of data on the stack
when they're called. They save BP, ES, DI, DS, and SI. Each of
those register values are 2 bytes (or 1 word), making 10 bytes
total.
Knowing this, you can look at your local variables by examining
the stack, because that's where FORCE allocates all of its local
memory from. For example, if you have a function that looks like:
PROCEDURE Mr_Function
VARDEF
int x
int y
ENDDEF
X is going to be at SS:[BP - 10d], (or SS:[BP - 0ah] in hex),
and Y is going to be at SS:[BP - 12d]
If you use SYMDEB as your debugger, you can just type
-e ss:bp-a
and it'll show you the value of X. If this information is going
to be of any use to you, you need to know the byte lengths of
the FORCE data types, so here they are:
BYTE 1
INT, UNIT 2
LONG, ULONG 4
LOGICAL 2
DBL 8
Just remember that CHAR strings are also allocated from the stack,
and are of their specified length or 255 otherwise.
Technical Questions
-----------------------------------------------------------------
Q: I keep getting a fixup error at Q_MEMORY.ASM when I link
my FORCE code with Borland's Turbo Link. Why?
A: FORCE code suddenly became imcompatible with Borland
products when Borland came out with TURBO C++. At that time,
they introduced TURBO LINK 3.0 (TLINK). TLINK versions 3.0 and
up do not work with FORCE at all, nor do the Borland C++ compilers
work (at least, I haven't been able to get them to work, and as
I understand it, the entire compiler and its library will have to
be rewritten if we want to stay compatible with Borland). The
incompatibility was caused when Borland decided to change the
structure of its OBJ files. Either we have to meet their
structure requirements, or hope that they create a compiler
switch which supports true Intel/Microsoft OBJ structure.
However, considering Borland's competitive stance with regards
to Microsoft....
------------------------------------------------------------------
6
FORCE FAQ (Frequently Asked Questions) 7
------------------------------------------------------------------
So, TLINK version 2.0, and probably all versions of MicroSoft's
LINK will work okay. We suggest that you use the MS link if you
have it. It may be a little slower than TLINK, but we know it
works.
See the file INTER_C for further discussion on C and FORCE here in
Area 12.
Q: All of my FORCE TSR's are taking up 80k+ of memory. Is
there anything I can do to cut that down?
A: Not really. FORCE TSR's were built to be bullet proof,
allowing them to be called in almost any situation. However,
that's a lot of ground to cover, hence the inordinately large
memory sizes. We have considered this carefully, and we've
decided that a solution would be impractical until the next
revision. The next version will feature better dynamic memory
management which in turn will allow TSRs to be much more frugal
with regards to their memory usage.
---------------------------------------------------------------
That's all for the moment folks (keep in mind these are
FREQUENTLY asked, and I do mean FREQUENTLY). I must have
answered that one about Tlink at least 3 dozen times in the
last two years...
If you have any suggestions for topics to be covered here in
the FAQ area (Area 12), please let me know. Just send a message
to me, David Holmes.
Keep checking the FAQ periodically. The file description
line will give the date of the latest revision.
--------------------------------------------------------------------