Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : FAQ.ZIP
Filename : FAQ100.3

 
Output of file : FAQ100.3 contained in archive : FAQ.ZIP
Archive-name: clipper-faq/part3
Last-modified: 1992/12/01
Version: 1.00


FREQUENTLY-ASKED-QUESTIONS (FAQ) LIST FOR CLIPPER
PART 3 OF 3
Copyright (C) 1992 by Mark W. Schumann

======================================================================
USE OF C AND ASSEMBLY LANGUAGE WITH CLIPPER.
======================================================================

Q. Can you combine Borland C/C++ or Turbo C/C++ code with your Clipper
applications?

A. Yes, if you follow these guidelines:

1. Use large model only (the -ml command-line compiler switch).
2. Use no floating point operations, and disable them with
the -f- switch.
3. Use no Borland library functions; you may use standard C
functions if they are found in CLIPPER.LIB or LLIBCE.LIB.
4. You may leave register variables on and/or optimize
for registers/jumps/speed.
5. You may use the -v switch to include debugging information
in your object code for Turbo Debugger.
6. Turn stack checking off.

One workable set of switches seems to be:

-c -f- -ml -N-

These switches work, delivering optimized C code:

-c -f- -ml -N- -Z -O -G -w

# Ed Boggan (72701,1720) Section 4 #158250 22-Aug-91
# Carl Nelson (70363,1027) Section 2 #172091 29-Oct-91
# Nick Pombra (71477,2077) Section 4 #156089 12-Aug-91
# Alex Matijaca (73657,3171) Section 2 #152148 24-Jul-91

----------------------------------------------------------------------

Q. How about C++?

A. Any C++ function which interfaces to your Clipper code must be
declared consistently as

extern "C" CLIPPER func (void)

This is an ANSI linkage specifier which turns off "name mangling."
One disadvantage is that if a function name is overloaded of course
you may only access one instance of that function name from your
Clipper code. (Otherwise how could Clipper tell them apart?)

C++ code which is not called directly from your Clipper application
can be safely left "mangled." For Borland C++ users, the normal
prohibitions on use of floating point math remain.

# Diane Lask (72357,3574) Section 4 #144114 17-Jun-91

-----------------------------------------------------------------------------

Q. Is there a way to recompile or relink the standard Clipper 5.01
libraries to make Clipper fully compatible with Borland C++?

A. No. Floating point math is too tightly coupled to the Borland
compiler itself. And if floats are not an issue with you, then
the Borland compiler is fine as is.

----------------------------------------------------------------------

Q. How do I compile Microsoft C 5.1 code?

A. The correct compiler switches are /FPa /Gs /Oals /AL. You may
use floating point math without restriction.

----------------------------------------------------------------------

Q. What about Microsoft C 6.0? And 7.0?


A. Use the undocumented /Gh compiler switch and the LLIBCA.LIB library
from Microsoft C 5.1. (The library is available on the NANGMBH
forum on Compuserve, and it may also be purchased from Microsoft
as a "downgrade" if you already are licensed to use 6.0 or 7.0.

# Don Caton (70007,5454) Section 4 #233968 26-Jun-92

----------------------------------------------------------------------

Q. Can you use Turbo Debugger with the embedded C and assembler
code in your Clipper application?

A. Yes. For best results, compile the C code with the -v switch,
assemble with /zi, and Turbo-link with /v. Then just fire up
TD with the name of your executable and set a breakpoint at
the beginning of your C or assembler function of interest.

I have found that TD286, Borland's 80286 protected-mode debugger,
works as well without crowding Clipper code out of memory. Still
you are probably better off testing your C/assembler code from a
small "shell" Clipper program to save run-time memory.

----------------------------------------------------------------------

Q. I want to write a C function that concatenates a list of
strings whose lengths are unknown at compile-time. How can I
do this efficiently?

A. If you're concerned about performance, the best possible solution
would be to define a maximum string length beforehand. If you can
do that, this piece of code, submitted by Brian Marasca (71230, 1650
on Compuserve), is pretty high-performance:

#define MAXLEN 120

CLIPPER cStrCat()
{
char *p, *q, *buf ;
int cx = 1, parms = _parinfo ( 0 ) ;

q = buf = _xgrab (MAXLEN + 1) ;

while (parms--)
{
p = _parc (cx++) ;
while (*p) *q++ = *p++ ;
}
*q = '\0' ; // very important!

_retc (buf) ;
_xfree (buf) ;
}

# Brian Marasca (71230,1650) Section 2 #172316 30-Oct-91

----------------------------------------------------------------------

Q. I want to call my C or assembler function with a reference parameter
in a string. Why can't you just use the pointer returned by _parc()
to modify a string parameter?

A. For Summer '87 code, the answer is that you can't modify a reference
parameter from C or assembler. Not reliably, anyhow.

For Clipper 5 code, Ted Means (73067,3332) provided this explanation
(somewhat edited) on Compuserve:

BEGIN Ted Means quotation

Clipper 5.0 performed under-the-hood memory optimizations that
sometimes resulted in two strings being assigned the same pointer.

For example, if you did this:

X := "Some string"
Y := X

In all likelihood Clipper would simply make a copy of the pointer
rather than actually copying the string. It sounds great in
theory, because it saves memory. But problems arose when a C or
ASM routine attempted to modify X or Y by writing directly to the
assigned memory. Since the same pointer was assigned to two
different memvars, they both got changed, even though that was
not the intended effect.

So with the release of Clipper 5.01, Nantucket graciously
provided a method for accessing strings that is more convenient.
If you call __StorCLen with a null pointer *before* calling
__ParC, it warns Clipper that you plan to directly modify a
__ParC pointer and Clipper will take whatever steps are necessary
to make it safe to do so.

This gives the best of both worlds, in that Clipper can still
perform its memory optimizations, but C and ASM programmers get
the benefit of being able to directly modify strings. This is
all documented in the Release Notes, but briefly, if you need to
write directly to a string, use the following sequence:

1) Call __ParCLen to get the string's length.

2) Call __StorCLen with the length and a null pointer.

3) Call __ParC to get a pointer to the string. This
pointer will be safe to write to.

Writing directly to a __ParC pointer without using this method is
not sanctioned by Nantucket and is likely to cause problems.
Note, though, that if you don't need to write to the string you
can simply call __ParC by itself.

END Ted Means quotation

# Ted Means (73067,3332) Section 4 #151944 23-Jul-91

----------------------------------------------------------------------

Q. How do I call Clipper code from C? Can this even be done?

A. Yes, but you have to set up Clip's internal EVAL stack properly
with _xpushf() and _xpopf() to do it. Afterwards, call _xdo()
to execute the Clipper function. The whole thing is undocumented,
and it is discouraged by CA/Nantucket because it requires the use
of internal functions which are not guaranteed to remain
unchanged from one Clipper version to the next. Most people
spend weeks poking around the symbol tables to get this to work.

# Steve Larsen (76370,1532) Section 4 #176347 19-Nov-91
# Jobst Hensiek (76656,1606) Section 4 #177670 25-Nov-91
# Jobst Hensiek (76656,1606) Section 4 #177304 23-Nov-91


======================================================================
CLIPPER AND OTHER ENVIRONMENTS.
======================================================================

Q. How do I port my existing Clipper code to a Unix system?

A. Available products for converting Clipper to Unix-compatible
C code include:

Firm Product Location
---- ------- --------

COMCON Flagship Vienna, Austria

Desktop AI dbXport Fairfield, Connecticut USA
Ecstasy (x2c) Usenet: x2c%[email protected]
Compuserve: Rich Roth 76137,3727

Recital Recital Massachussetts, USA
+1 508 750 1066

None of these currently support translation of Clipper 5 code.


C Libraries for using .DBF and index files include:

Firm Product Location
---- ------- --------

APIS
Software herCules Frankfurt/Main, Germany

Includes source code, understands NDX, MDX, NTX, and IDX
files. Supports DOS, Windows, OS/2, and UNIX/XENIX.

SoftC, SoftC Database 16820 Third Street NE
Ltd. Library Anoka, Minnesota 55304-4703 USA
+1 612 434 6968
Compuserve: Mr. Kim Schumann 73667,3420

Source code and Windows DLL included in US $195 package.
Supports DOS, Windows, OS/2, and UNIX/XENIX.

Again, no endorsement is implied here.

# Nantucket GmbH (76670,2224) Section 1 #153090 29-Jul-91
# Guenter Schwaninger
1-Dec-92.

----------------------------------------------------------------------


Q. How do I translate Lotus files into DBF format?

A. Check out Calc(DB) by Pinnacle and ClipWKS by Grumpfish.
"The key difference between the two is that Calc(DB) is a
spreadsheet engine that performs full calculations and macro
execution on worksheets (or any other data set) and ClipWKS
focuses primarilly on access-only of worksheet data without
any data-integrity checking," says Jeff Jochum, whose company
produces Calc(DB).

You can also use the Lotus Translate utility, or even load
the spreadsheet into Quattro Pro and then save it with a .DBF
extension.

# Jeff Jochum [Successware] (76665,3367) Section 9 #177065 24-Nov-91


----------------------------------------------------------------------

Q. I want to read and write files on my IBM minicomputer(s): a
System/38 or AS/400. How can I accomplish this?

A. A product from Aladdin allows your Clipper application to access
native AS400 data files at the record level. Call Aladdin at
+27 11 642-4588 or Compuserve 73427,1172. Technical support was
promised to be available in Los Angeles, California USA beginning
January 1992, but I have not verified this.

# Brad H. Codd [Aladdin] (73427,1172) Section 2 #179605 02-Dec-91
# Brad H. Codd [Aladdin] (73427,1172) Section 2 #179909 04-Dec-91


======================================================================
THIRD-PARTY LIBRARIES AND UTILITIES.
======================================================================

Q. What's the big deal about this FoxPro Rushmore Technology? I am
thinking about switching from Clipper to FoxPro!

A. Rushmore is not an index type, nor is it magic as the Fox people
would have you believe. It is simply a FoxPro feature that
automatically figures out the most efficient way to use existing
indexes in a query (LOCATE, LIST, anything with a FOR clause,
etc.).

Rushmore is handy for interactive queries, but most application
developers can know ahead of time what lookups need to be done
on their database files and can arrange for an optimized lookup
the old-fashioned way with little effort.

That's why the Rushmore test results look so good but are not very
relevant to what many application developers really do. If you
are trying to write a very open-ended reporting program, on the
other hand, it may be just the ticket.

----------------------------------------------------------------------

Q. Someone said I could access FoxPro-type indices. What is the
difference between FoxPro indices and Clipper indices? What gain
can I get from doing that, and how?

A. The SIx Driver by Successware, about $150, gives you access to
Fox-type .IDX and .CDX index files. The nice thing about .CDX
files is that they can contain more than one "tag," each of which
relates to a key value. Therefore you can drop all your many
Clipper .NTX files by converting each to a "tag" within a single
.CDX file. This also lets you always open a file with USE
INDEX with assurance that you got all the tags.

SIx does not give you Rushmore lookups, but it is shipped with an
add-in called MACH which does.

For more information, send email to Loren Scott of Successware at
70274,2677 on Compuserve.

If want traditional Clipper .NTX index files, but also want
a "Rushmore" sort of feature, there is a library called ClipMore
which claims to accomplish this. ClipMore costs US $150 and is
published by Loadstone, Inc./215 Barmount Drive/Columbia, South
Carolina 29210 USA. Loadstone's telephone number is +1 803 731
9128.

Finally, if you can wait until the release of Clipper 5.2, a
FoxPro-compatible RDD will be included.


======================================================================
MISCELLANEOUS.
======================================================================

Q. How do I print USA postal barcodes with my Clipper application?

A. Try the C Gazette issue of Winter 1990-91 (Volume 5, Number 2) for
details on the format. If you know C the translation into Clipper
can't be very hard. If you don't know C you will find the syntax
embarrassingly similar to Clipper anyway.


----------------------------------------------------------------------

Q. What is this Stacker product I keep hearing about?

A. According to Cliff Korth (who is not affiliated with Stac, Inc., the
producer of Stacker), "Stacker is available in both a
hardware/software version and a software only version. The hardware
version offers slightly better speed performance and requires less
RAM to load. In addition the hardware version includes the software
version so that if the board fails the software version takes over....
It works by creating a single file on your hard disk that holds all
the other files in compressed form.... Any read/write requests to
the Stacker volume are handled transparently as far as your DOS apps
are concerned."

# Cliff Korth (74000,2555) Section 1 #177173 22-Nov-91


======================================================================
GETTING HELP AND FINDING OUT MORE ABOUT CLIPPER.
======================================================================

Q. What books can help me learn Clipper?

A. Download the file BOOKS.LST from Library 0 of the CLIPPER Forum
on Compuserve.

----------------------------------------------------------------------

Q. What bulletin boards are available for Clipper developers?

A. Here is the list of those I know about. Please inform me of
any others you may come across.

Country Telephone bps
------- --------- ---

Australia
Melbourne +61 3 752 3935 2400 v32/42/42bis
+61 3 752 3931 9600 v42
Melbourne Clipper User Group
(Also 3:634/389 on Fidonet)

Canada
Ontario +1 416 538 3107
Artful Applications, Inc.

United Kingdom
+44 065679477 14400 HST
Welsh Wizard
(Also 050/061 on GT Power)

United States
New Jersey +1 201 568 7293 9600
"The BOSS" Mark Seiden
Maryland +1 301 251 9206 9600
"Darwin" P.L. Olympia
Texas +1 817 695 0058 2400
Vernon Six
California +1 818 332 6580 2400
Sean Thakkar (76414,452 on Compuserve)


Of course there is also Compuserve, truly the meeting place of
the Clipper developers' community. 2400-baud access costs at
least $12.50 per hour in the United States and Canada, and much
more elsewhere. When you join Compuserve, type GO CLIPPER to
join the Forum, where CA/Nantucket staff people and (I mean this
very literally) hundreds of other Clipper developers visit every
day to check messages, ask questions, and offer help. The CLIPPER
forum also carries what must be the largest collection of public
domain, shareware, and freeware of interest to Clipper developers.

For more information on joining Compuserve, please call (in the
United States) 1-800-848-8980. This is a voice-only number.
I will be happy to provide phone numbers or other pointers for
non-U.S. users.

If you use the Usenet/Internet and need to write email to a
Compuserve mailbox, simply replace the comma in the user's
address with a period, and then append "@compuserve.com" to
the result. (Therefore you can reach my Compuserve mailbox
73750,3527 as <[email protected]> from Usenet.)

----------------------------------------------------------------------

Q. Is there a mailing list for Clipper users on the
Usenet/Internet/Bitnet? Fidonet? Others?

A. Yes. You can subscribe by sending the message "SUBSCRIBE CLIPPER
Your-Name-Here" to . Send list contributions
to ; administrative requests go to
.

On Fidonet, check the CLIPPER echo.

There is also an active Clipper echo on the cozier but lesser-known
GT Power network.

----------------------------------------------------------------------

Q. Is there a Usenet newsgroup on Clipper?

A. No. In fact, there doesn't seem to be any Usenet newsgroup that
carries a substantial amount of Clipper traffic, unless you count
the newsgroups which are gatewayed from the Bitnet DBASE-L and
CLIPPER mailing lists. Otherwise, the nearest thing is
alt.msdos.programmer.

----------------------------------------------------------------------


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : FAQ.ZIP
Filename : FAQ100.3

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/