=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=--=-=-=-=-=     

			  P  A  R  A  D  O  X

				 F A Q

	 
	 Frequently Asked Questions for comp.databases.paradox

			 version 2.6, 11/27/94          

			    Maintained by:
		  J. Allen Dove (adove@dsigroup.com)
		   Roger L. Yee (ryee@dsigroup.com)
	       
	DISTRIBUTE FREELY. COMMERCIAL DISTRIBUTION PROHIBITED. 
	 
    Comments, Suggestions, Additions, Updates to: dev@dsigroup.com 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=--=-=-=-=-=

CONTENTS                                   * denotes NEW or UPDATED items

1.0 INTRODUCTION
	1.1 Comp.databases.paradox Netiquette
	1.2 Administrivia
      * 1.3 Maintainers' Note

2.0 PARADOX SUPPORT
	2.1 Borland Phone Services    
	2.2 Borland Online Services   
      * 2.3 Other Online Services
	2.4 Other FTP Archives
	2.5 FAQ Updates
	
3.0 PARADOX-RELATED PUBLICATIONS

4.0 FREQUENTLY ASKED QUESTIONS [General/DOS/WIN]
	4.1 Why isn't there a separate news group for DOS and
		Windows?
	4.2 What is the current version of Paradox? [DOS,WIN]?   
	4.3 How do I do a not-in query? [DOS, WIN]
	4.4 How do I make a generic query that can be used with
	    several tables?[DOS, WIN]
	4.5 How do I query for the top/bottom 5 records? [DOS, WIN]
	4.6 How do I create calculated fields [DOS, WIN]
	4.7 Why didn't my variable query work? [DOS,WIN]
	4.8 How do I restrict input to upper-case only? [DOS,WIN]
	4.9 Why can't I open the table? [DOS,WIN]
	4.10 Where did that table come from, and where did it go?[DOS,WIN]
	4.11 How do I auto-number a field for ID's? [DOS,WIN,WIN5]
	4.12 How to I prevent Ctrl-Break? [DOS,WIN]
	4.13 How do I get certain sequences to sort properly? [DOS,WIN]
	
5.0 FREQUENTLY ASKED QUESTIONS [WINDOWS SPECIFIC]
	5.0.1 Section Notes
	5.1 How much memory does Paradox require? [WIN5]
	5.2 Where/What is the Paradox for Windows Runtime? [WIN]
	5.3 Why is Paradox for Windows so darn slow? [WIN,WIN5]
	5.4 How do I send reports to a text file? [WIN]
	5.5 How do I get Paradox/Win running on OS/2? [WIN]
	5.6 How do I access calculated fields? [WIN]
	5.7 When should I use a filter (Order/Range) vs. Query?[WIN]
	5.8 Why can't I change data on a detail table? [WIN]
	5.9 Why does the Form and Report experts fail to work? [WIN5]
	5.10 How do I create a report in Paradox for Windows that allows 
		a report to correct problems with decimal alignment with 
		negative numbers?[WIN]
	5.11 How do I pass variables from one form to another? [WIN]
	5.12 I am using ODBC drivers. Why can't I access my Paradox 
		tables? [WIN]
	5.13 How can I use a Paradox for Windows form to send data to a
		WPWIN 6.0a document? [WIN]
	5.14 How do I fix an ASCII printing problem when it occurs?[WIN]
	5.15 What is the Borland Database Engine? [WIN]
	5.16 Is there a way to display an entire Memo Field on a form 
		so that it's ready for user navigation and editing without 
		pressing "Shift-F2"? [WIN]

6.0 FREQUENTLY ASKED QUESTIONS [DOS SPECIFIC]
	6.1 How does Paradox round numbers? [DOS]
	6.2 How can I delete an arbitrary file? [DOS]
	6.3 What are these *&!# files doing here? [DOS]
	6.4 Where's the arrive trigger? [DOS]
	6.5 How do I get the disk drive letters? [DOS]
    
7.0 BUGLISTS/WORKAROUNDS

8.0 PARADOX 3rd PARTY PRODUCT DIRECTORY

-----------------------------------------------------------------
1.0 INTRODUCTION

Welcome to the comp.databases.paradox FAQ. This document attempts to 
answer frequently asked questions regarding the Paradox product and 
related topics. Your contributions are necessary for this document 
to be useful. Please send any information you think is needed for or 
useful to this document to the FAQ address at:  dev@dsigroup.com
or post to the Usenet news group comp.databases.paradox.


1.1 Comp.databases.paradox Netiquette

When posting to comp.databases.paradox, please specify in your
article subject the use of the following subject codes:

[ANNC] - announcements, press releases, seminars, etc.
[DOS] - for all DOS versions
[WIN] - for all WINDOWS versions
[SOFT] - software add-ons, utilities
[CODE] - sample code, code tricks/tips, etc.
[BUG] - bugs, errors, workarounds, etc.

Some subjects, such as queries, data formatting, etc., etc. will 
obviously apply to both. If you are using a version other than the 
current versions specify that also, for instance "[DOS35] Wait 
Processing".

If you are cross-posting this article to other groups, such as
comp.databases, please specify PARADOX or PDX in the subject, so they'll 
know what the heck you're talking about.

If you include code examples in your message, please check to
make sure they work. If it isn't tested exactly as written,
please at least say so *AHEAD* of the code. If it is something
someone asked for, and you aren't sure your method will work for them,
try e-mailing to them first, to hammer out the specs, then one of
the two of you can post the real answer.


1.2 Administrivia

Paradox is a registered trademark owned by Borland International,Inc.
MS-Windows is a registered trademark owned by Microsoft Corporation.
Other product and corporate names may be trademarks of other 
companies, and are used only for explanation and to the owners' 
benefit, without intent to infringe.

This document is not an official document of or endorsed by Borland
International, Inc.
---------------------------------------------------------------------
Copyright (c) 1994, 1995 DSi group. This electronic collection of Paradox
information is a publication of the DSi group. Electronic redistribution
is hereby granted if document is unaltered or modified and all notices
remain intact. Commercial and/or printed distribution is prohibited. 
All Rights Reserved.
---------------------------------------------------------------------

1.3 Maintainers' Note

This update of the FAQ has not changed very much. Please remember that to 
make the FAQ a valuable reference tool, we need your contributions 
whether it be tricks, tips, bug work-arounds, sample code etc. 

The FAQ is still in need of someone to help maintain the DOS side. Our 
own expertise is in the Windows side. So, any volunteers? 

Once again, thank you for your input and help in compiling this 
FAQ. As always, ALL responses and comments are welcomed!

Thanks in advance.

J. Allen Dove            Roger L. Yee
FAQ Co-Maintainer        FAQ Co-Maintainer
DSi group                DSi group
adove@dsigroup.com       ryee@dsigroup.com

*****************************************************************

Special Thanks to Joel Finkle, the original founder of this FAQ

Thanks is given to the following contributors:

Bill Chosiad (billc@world.std.com), Carey Klenetsky (carey@limax.com),
Dave Yuhas (dave@crl.com), Dean Bowes (bowesd@thomas.ge.com), Donald R.
Oddy (donald@grove.demon.co.uk) Jeff Stevens (stevens@sirius.scubed.com)
Joe Costellessa (cotellessa@DGS.dgsys.com) Joe Humphreys
(joe.humphreys@ggcs.org) Joseph Bentley (joe@slick.limax.com) Ken Ostrin
(ken@limax.com) Krzysztof Zmudzinski (krystof@cs.washington.edu) Kuo-Sheng
"Kasey" Chang (kschang@mercury.sfsu.edu) Mark West (markwest@delphi.com)
Matthew McDermott (mcs@ucsco.ucsc.edu) Mean Green Dancing Machine
(aahz@netcom.com) Nasir Ahmed Noor (ummalik@ccu.umanitoba.ca) Reinoud van
Leeuwen (Leeuwen@rullf2.LeidenUniv.nl) Stuart Tomares, M.D.
(stomares@welchlink.welch.jhu.edu)

Thanks to the DSi group for providing Internet network and related 
resources for this endeavor.

-----------------------------------------------------------------
2.0 PARADOX SUPPORT

2.1 Borland Phone Services
Recently, Borland abandoned free human-moderated telephone
support, as did much of the computer industry. They do provide a
number of means for support, though.

TechFAX:        1-800-822-4269
This has touch-tone menus to send answers to common questions to
your FAX machine (3 will send a catalog of documents available)

Automated Support:      1-800-524-8420
This has touch-tone menus for recorded answers to common
questions (2 for Paradox related questions)

Advisor Line:   1-900-555-1000 Paradox DOS
			1-900-555-1006 Paradox Windows
	     $2.00 per minute, first minute free

Credit Card Advisor:  1-800-468-9990 Paradox DOS
			 1-800-452-1333 Paradox Windows
	$2.00 per minute, first minute free, VISA, 
       MasterCard, American Express

Other Borland Phone Numbers:
Product Registration:   1-800-845-0147
Order Line:                             1-800-331-0877


2.2 Borland On-Line Support
America Online                  Keyword: APPLICATION
Anonymous FTP                   ftp.cica.indiana.edu
					Directory: /pub/pc/win3/programr
Automated Support BBS           1-408-431-5250
BIX                             JOIN BORLAND
Borland BBS                     1-408-431-5096
Borland FTP                     ftp.borland.com
					Directory: /pub/lib
CompuServe                      GO BORLAND or PDOXWIN or PDOXDOS
Delphi                          Paradox SIG (go cust 320)
GEnie                           BORLAND


2.3 Other On-Line Services
USENET/Newsgroups               comp.databases.paradox
Digest of c.d.paradox   <unconfirmed>
Paradox Informant BBS   1-916-686-4740

Paradox and PDOXWIN Mailing lists: 
<NOTE>
Unconfirmed - reports are that this mail list is not in operation. Any 
information about this server, please let us know.

Send mail to:

LISTSERV@BRUFPB.BITNET In the body of the message, with no header, type

SUB PARADOX (your full name) or SUB PDOXWIN (your full name)

To post to these lists, mail to PARADOX@BRUFPB.BITNET or
PDOXWIN.BRUFPB.BITNET. PDOXWIN does not appear to be active. PARADOX 
receives about five messages per week.


2.4 Other FTP Archives
ftp.cica.indiana.edu (and mirrors) maintains a Paradox archive in 
/pub/pc/win3/programr. Code samples as well as selected files from 
Paradox Informant are in this archive.

BrainLINK BBS/FTP System
This is a FTP/TELNET site that has a number of Paradox related files 
for both DOS and WINDOWS versions.
TELNET/FTP to:  199.184.242.4
Rajesh Goel is the owner - frostbit@dorsai.dorsai.org


2.5 FAQ Requests
To obtain the latest copy of the FAQ via mail-server, 
send e-mail message to:
  dev@dsigroup.com
  Subject line containing: GET PDOX FAQ
  Message Body: <ignored>

The FAQ is updated and cross-posted monthly to the following 
newsgroups:
  comp.databases.paraodx
  comp.databases
  comp.answers
  news.answers

Anonymous FTP will be available in the near future.

-----------------------------------------------------------------
3.0 PARADOX-RELATED PUBLICATIONS

3.1 Paradox Developer's Journal
	Published monthly by the Cobb Group
     1-800-223-8720 or 502-491-1900

     Customer Relations
     9420 Bunsen Pkwy, Suite 300
     Louisville, KY 40220
     Internet: JEFF_DAVIS@MM.COBB.ZIFF.COM

     Subscriptions <as of 1/94> $79/yr or $99/yr outside of U.S.
     Resource Disks $49/yr, $29/6 mo., $9.95 per issue
Typically 16-20 pages, containing both Windows and DOS
information. Targeted at developers, contains PAL and ObjectPAL
code information.


3.2 Paradox User's Journal
     Published monthly by the Cobb Group
     1-800-223-8720 or 502-491-1900

     Customer Relations
     9420 Bunsen Pkwy, Suite 300
     Louisville, KY 40220
     Internet: JEFF_DAVIS@MM.COBB.ZIFF.COM

     Subscriptions <as of 1/94> $79/yr or $99/yr outside of U.S.
     Resource Disks $49/yr, $29/6 mo., $9.95 per issue
Typically 16-20 pages, containing DOS-only Paradox information. 
Mostly aimed at users of Paradox, including form and report
design, simple scripts, queries.


3.3 Paradox for Windows Journal
     Published monthly by the Cobb Group
     1-800-223-8720 or 502-491-1900

     Customer Relations
     9420 Bunsen Pkwy, Suite 300
     Louisville, KY 40220
     Internet: JEFF_DAVIS@MM.COBB.ZIFF.COM

     Subscriptions <as of 1/94> $79/yr or $99/yr outside of U.S.
     Resource Disks $49/yr, $29/6 mo., $9.95 per issue
Typically 16-20 pages, containing Windows-only Paradox
information.  Mostly aimed at users of Paradox, including form
and report design, simple scripts, queries.


3.4 Paradox Informant
     Published Monthly by Informant Communications Group
     916-686-6610

     10519 E. Stockton Blvd, Suite 142
     Elk Grove, CA 95624-9704
     CompuServe: Jerry Coffey 70304,3633, MCI mailbox JCOFFEY

     Subscriptions: <as of 1/94> $44.95, Canada $49.95, 
     Central/South America $75,All Others $115.

Typically 80-92 pages, containing everything from basic tutorials
to in-depth technical articles.  Excellent magazine.  Maintains
the Paradox Informant BBS (PIBB) listed above.


3.5 Data Based Advisor
     Published Monthly by Data Based Solutions, Inc
     800-336-6060 or 619-483-6400

     4010 Morena Blvd. Suite 200
     San Diego, CA 92117
     CompuServe 70007, 1614; MCI Mailbox DATABASED

     Subscriptions <as of 06/94> $35/yr, Canada $55, Others $75
     Index of articles available on disk for $17.49
	Covers most of the personal-computer-based Database world.  
	Good articles on Paradox are common.


3.6 Instant Scripts
     Published by LAPALS, the Southern California 
     Paradox Users Group
     310-541-3461

     4009 Montaigne Way
     Palos Verdes, CA 90247
     Annual Membership $45, International $120.  
     Make checks payable to Nancy Chalnick, LAPALS Membership Director.  
	Sample issues available. High quality articles on Paradox.

-----------------------------------------------------------------
4.0 FREQUENTLY ASKED QUESTIONS [General,DOS,WIN]

4.1 Why isn't there a separate news group for DOS and Windows? [DOS,WIN]
You need a large number of people to authorize a NEW news group. Besides, 
there's still a good number of messages that are useful for both DOS and 
Windows users (see below). However, if there is enough response, 
splitting the FAQs may be an option: one covering general techniques and 
questions on DOS and Windows and a developer's version targeting 
specifically Paradox for Windows/ObjectPAL application development.

Sharing platforms is not uncommon in other newsgroups, for
instance, rec.games.video.sega discusses GameGear, Genesis, etc.


4.2 What is the current versions of Paradox? [DOS,WIN]
	>>  Paradox for Windows version 5.0
	>>  Paradox for DOS version 4.5


4.3 How do I do a not-in query? [DOS,WIN]
With two tables with a common key, (for instance, Customer ID),
how do I find which records in one table have no matches in the
other (for instance, customers with no orders)?

Create a Paradox Query (.SC for DOS or .QBE for Windows) that
looks like this:

     CUST | Customer ID  | Address | City    | State   |
	  | Check _Cust! | Check   | Check   | Check   |

     ORDER      | Customer ID       | Order Num    |
		| _Cust, count = 0  |              |

     ORDER      | Order Date   | Total Cost   |
	       |              |              |

This will find those customers who haven't placed an order. To expand 
this method, put "> 1/1/94" in the Order Date (without the quotes), this 
will find those customers who haven't ordered this year.

This works because queries execute their operations in the
following sequence:

* Search for actual values or ranges
* Join tables
* Execute aggregators

Because the COUNT gets done *after* the join, it removes records
from ANSWER that do not have a corresponding record in Customer
ID.


4.4 How do I have a generic query that can be used with several
	tables? [DOS,WIN]
In Paradox for DOS, you don't. Query expressions can not use
variables for table names.

[WIN] 
In Paradox for Windows, you may use something like:

     ~strTblName    | Patient ID   | Age     |
		    | Check        | > 65    |

You can use QueryString, which uses the same syntax but you can
substitute your own piece(s) of string.  This is very useful in that 
it can supply something a bit fancier than a ~(tilde) variable.

If multiple tables have the same structure but contain different 
sets of data, they probably should be a single table with an ID field 
that 
sets them apart.

[DOS]
The best you can do with Paradox for DOS is either:
a) Copy or Rename your table to the generic table name used in
	your query, or 
b) Use 'scripting' commands to create the Query on the fly. 

Borland cautions that you must ensure proper naming of variables
and tables. A good method is to begin by recording an instant
script (F3), and replacing table names with variables.

     MENU {ASK} SELECT TheTable 
     MOVETO [Patient ID] CHECK 
     MOVETO [Age] TYPEIN "> 65"


4.5 How do I query for the top/bottom 5 records? [DOS,WIN]
This looks rather strange, and can be time consuming, but will
select the records with the five highest values in a table:

     QUERY

     TEST | Order        | Total Invoice  |
     SET  |              | _a             |
     SET  |              | <max _a,_b     |
     SET  |              | <max _b,_c     |
     SET  |              | <max _c,_d     |
     SET  |              | <max _d,_e     |
	  | Check        | Check >=max _e |

ENDQUERY

It works by asking on each line to find a set of records less
than the greatest value in the previous set. When you get to _e,
you've defined a set missing the four highest Invoice records. 
The last line selects records greater than or equal to that set,
thus finding the five greatest records.

Another way to do this, if all values in that field are unique, is to
put a secondary index on that field. Then you can have as many as 
you want quickly and easily.


4.6 How do I create calculated fields [DOS, WIN]
A table can't have an auto-calculated field, unfortunately.  What
can you do?

a) A form or report can have a field calculated from other
	fields, and a limited number of functions.
b) Your WAIT procedure can look for a POSTRECORD trigger, and
	calculate a field in  your table there (Windows folks need to
	trap the correct Action).
c) A query can update a field with the CHANGETO command, or
	create a new field with the CALC command.
d) Use a SCAN loop
     SCAN
	[That Darn Field] = [Another Field] * 10
     ENDSCAN

For Windows, use
     SCAN MyTCursor:
	MyTCursor.That_Darn_Field = MyTCursor.Anotherfield * 10
     ENDSCAN


4.7 Why didn't my variable query work? [DOS,WIN]
Using Tilde Variables in Paradox Queries provides quite a bit of
power to have a query that is changeable at run-time. However,
there are a few restrictions.

Example Query:

     Table      | Customer     | Name    | State        |
		| Check        | Check   | ~strState    |

a) strState must be a *string* variable.  Even for numeric or
	date fields, strState must be a string expression that is
	inserted into that spot on the query table.
b) strState is the criteria, not the whole shebang that would go
	in the field. In other words, it behaves as if it were typed in
	enclosed in parentheses, so commas, underbars, ORs, etc. etc. are
	not processed.


4.8 How do I restrict input to upper-case only? [DOS,WIN]
The Picture for a field or ACCEPT can be set to "*&" for
all-uppercase, letters-only, or "*!" for all-uppercase, any
characters.  

[WIN] 
If this is in a form's field, you can do self=self.upper() in
the changevalue method for automatic capitalization. However, it 
would be better to use the picture on the field definition instead.
For more information see the on-line help and on "Picture String 
Characters".

[WIN]
If for some reason you don't want to make picture restrictions on 
the table, you could use the following piece of code as a field's 
keyChar method on a form:

method keyChar(var eventInfo KeyEvent)

  eventInfo.setChar(upper(eventInfo.char()))

endmethod

This has the advantage that it can be used on a form field not 
assigned to any particular table field.


4.9 Why can't I open the table? [DOS,WIN]
Paradox for Windows and Paradox DOS apparently think that files
in the wrong format are merely password protected. This beats
trying to mangle a file it can't use, but a "Wrong Version,
Stupid" error message would probably be preferable.

Typical situations that cause erroneous Password messages
include:

a) A Paradox DOS table that has Set Protect Write-Protect on
	it, that you try to open in Windows. There is no equivalent
	function in Windows, you've got to clear the Write-Protect in
	DOS.
     
b) A Paradox Windows table with Strict Referential Integrity
	set on it that you try to open in DOS.

c) A Paradox 4.0 or 4.5-formatted table that you try to open
	in Paradox 3.5. 

Note that all versions of Paradox let you set a "Compatible"
format when reformatting a table.


4.10 Where did that table come from, and where did it go? [DOS,WIN]
Paradox creates a number of temporary tables during processing. 
They are normally deleted upon exit from Paradox.  If you have
set a private directory, they will be in that directory,
otherwise, in the current directory.  Don't delete these files,
unless you have exited Paradox. See also DOS question 6.x.

Table                    Version        Comments
------                   ----------     -------------
Answer                   Dos, Win       Query Result table
Changed                  Dos, Win       Records changed in a
							CHANGETO query
Chantemp                 Dos
Crosstab                 Dos, Win       Created with the Crosstab
							command
Deleted                  Dos, Win       Records deleted in a
							DELETE query
DelTemp                  Dos
Entry, Entry1, Entry2..  Dos            Created during DataEntry
							command
ErrChng                  Win
ErrDel                   Win
ErrIns                   Win
Export                   Win
Family                   Dos            Tools/Info/Family Command
Import                   Win            Family
Inserted                 Dos, Win       Records added with an
							INSERT query
Instemp                  Dos
KeyViol, KeyViol1...     Dos, Win       Key Violations
							(Add, Insert Query, Restructure)
Kvtemp                   Dos
List                     Dos            Item lists from Tools commands
Locks                    Win
Pal$src                  Win            Created during EXECUTE commands
Password                 Dos
Passtemp                 Dos
Problems,Problems1..     Dos, Win       Errors during restructures
Probtemp                 Dos
Resttemp                 Dos
Sortques                 Dos
Struct                   Win            Created during restructure or 
							structure listing.


4.11 How do I auto-number a field for ID's? [DOS,WIN,WIN5]
You will need to trap for new record insertion (TriggerType =
INSRECORD in DOS 4.5 WAIT procedures, eventInfo.Id () =
DataInsertRecord in Windows Action method).

You can then calculate the next available value as:

DOS: [RecordID] = CMAX(TABLE(),[RecordID])
WIN: RecordID = CMAX(TheTable.CMAX(RecordID))

***Remember, if you use column operators, the method will try to
place a WRITE lock on the table.  This is usually ineffective in
a multiuser environment as other will need more than just read
permissions and you may not get the lock.

[WIN5]
Paradox for Windows 5.0 implements the auto-increment field.

[WIN]
An better method that can be used in multi-user environments is
to save the value in another table  and increment it.  This is
somewhat more complex, but prevents two users from creating the
same record ID at the same time.  It is very simple to write a
reusable method that would perform the action on any code table
that conforms to a set structure.  The following works in Paradox
for Windows:

     method NextKey (strTblName string,
	       strParameterFldName string,
	       strParameterValue string,
	       strKeyFldName string,
	       strKeyType string,
	       anyKeyIncrement anytype,
	       var anyKeyValue anytype) logical

	var
	   tc       tcursor;
	endvar

	try
	   tc.Open (strTblName);
	   if not(tc.Locate (strParameterFldName,
	   strParameterValue))
	   then
	      ;//could not find parameter value
	      tc.Close ();
	      Return (FALSE);
	   endif
	   tc.Edit ();
	   while not(tc.LockRecord ())
	      ;//insure that we can get exclusive rights to the
	      ;//record temporarily
	      Message ("One moment, locking key record...");
	      Sleep (500);
	      Message ("");
	   endwhile
	   switch
	      case (strKeyType = "N"):
		 tc.FieldValue (strKeyFldName, anyKeyValue);
		 tc.SetFieldValue (strKeyFldName,
		    (Number (anyKeyValue) +
		    Number (anyKeyIncrement )));
	      case (strKeyType = "S"):
		 tc.FieldValue (strKeyFldName, anyKeyValue);
		 tc.SetFieldValue (strKeyFldName, 
		    (SmallInt (anyKeyValue) +
		    SmallInt (anyKeyIncrement )));
	      ...
	      ;// do same for other types that can be incremented
	      ...
	      otherwise:
		 ;//invalid data type
		 tc.CancelEdit ();
		 tc.Close ();
		 Return (FALSE);
	   endswitch
	   tc.PostRecord ();
	   tc.Close ();
	   Return (TRUE);
	onfail
	   if (tc.IsAssigned ())
	   then
	      if (tc.IsEdit ())
	      then
		 tc.CancelEdit ();
	      endif
	      tc.Close ();
	   endif
	   Return (FALSE);
	endtry

     endmethod

Just remember to do a type conversion when using anyNewKey after
executing this method.  Obviously, you can add any other functionality 
you need.  

A similar procedure can be written for Paradox DOS.


4.12 How to I prevent Ctrl-Break? [DOS,WIN]
[DOS]
At first, it would appear that the "Disable Break" command in the
Custom Configuration Utility would be the solution.  However,
documentation indicates that this feature is solely to prevent
erroneous breaks that can be generated by some European
keyboards.

The solution to preventing breaks is to password-protect the
highest-level script that you wish to keep from 'break'-ing.  All
routines called by this routine will prevent breaks.

[WIN]
Strangely, even with "Ctrl-Break enabled" off, pressing Ctrl-Break 
stillbrings up the dialog box "Do you really want to stop?", and if 
you select Yes, you'll get the error and the Design button.

The only way to get around this (that I've found) is to use Delivered
objects, which does not stop.  Do [object] Deliever in design mode, 
then open the ?DL version, NOT the ?SL.  [Note] If you do not specify, 
.?SL is opened first.

4.13 How do I get certain sequences to sort properly? [DOS,WIN]
Having either of the following 2 sequences:
	a1  a2  a3  ...  a8  a9  a10  a11  a12 ...
	1.1  1.2  1.3  ...  1.8  1.9  1.10  1.11  ...
Paradox is sorts them so that a10, a11, a12 ... (or 1.10, 1.11, ...) 
appear BETWEEN a1 and a2 (or between 1.1 and 1.2)

Paradox, like most software, sorts in ASCII order.  The "improper"
result thus is the correct one.  To get the "proper" sort order,
you have to perform what some call a "Dewey Decimal" sort.  You
must either: (1) restructure your table to subdivide the field into
its components, treating numeric strings as integers, or (2) write
your own PAL or OPAL code to do this.

If writing your own code, you can use the breakApart function [WIN]
or the substr function [WIN, DOS] to separate the string into its
components. Then use the numVal function to convert numeric strings
into integers. Finally, perform a multi-key sort to get the desired
result.

-------------------------------------------------------------------
5.0 FREQUENTLY ASKED QUESTIONS [WIN]

5.0.1 Section Notes
Techniques and answers in this section relates to both version 4.5 and 
version 5.0 of Paradox. Where applicable only to version 5.0, the 
notation [WIN5] is used.


5.1 How much memory does Paradox require? [WIN5]
Paradox for Windows 5.0 requires 6 megs and recommends 8 megs.
Performance seems to top out at 12 megs.


5.2 Where is the Paradox for Windows Runtime? [WIN]
Runtime for version 4.5 available. Runtime for version 5.0 wil be 
available shortly.


5.3 Why is Paradox for Windows so darn slow? [WIN,WIN5]
[WIN] version 4.5
Borland requires at least 4MB of memory, but recommends 6MB, on
your Windows system for adequate performance. In truth, Paradox
runs "acceptably" with 4 meg on a fast 486, but that's still not
optimally.  For any moderately complex database, you will want at
least 8MB, especially on 386 processors. Paradox for Windows is
just such a powerful beast that you more or less insult it by
offering up any less.

One difference between DOS and Windows Paradox is that the
Windows version does case-insensitive searching with the Locate
command.  This can be removed by checking the Case Sensitive
check box on the Locate command (Ctrl-Z). This makes you have to
be more careful, but it's several times faster. Also, if you
find you are doing frequent searches on a non-key field, create a
maintained secondary index on that field. This should also help
locate speeds.

[WIN5]
See question 5.1


5.4 How do I send reports to a text file? [WIN]
Using the Windows Control Panel Printer icon, create a Generic/Text 
printer, and use the Connect button to specify FILE:.  You can then print 
your reports to this printer, and you will be asked to specify a file. 
Note that only non-proportional fonts (such as Courier, System), and only 
text will appear in the report.

Also note that strange effects can occur in the output, like:
	  BBB
	AAA CCC EEE
	     DDD 
when you wanted all 5 fields to appear on the same line. These effects 
seem to stem from micro misalignments of fields on the report design 
screen, and Borland and Microsoft seem to be disputing whose bug it is. 
To correct this problem, define a single calculated field that consists 
of all 5 fields, like:  
      [Tbl.Fld1]+" "+[Tbl.Fld2]+ ... +" "+[Tbl.Fld5]


5.5 How do I get Paradox/Win running on OS/2? [WIN]
Borland has a Technical Information Document called "Configuration Issues 
of  Running P4W under OS/2 v2.1." It is available from the Borland 
Download BBS and ftp.cica.indiana.edu as TI1674.ZIP, and from Borland 
Tech FAX as number 1674.  See above for how to reach these sources.


5.6 How do I access calculated fields? [WIN]
For example, an ANSWER table created by a query has a field
called "Sum of Amount".  How do I access this in my methods?

If you had created a form object yourself, the default name for
this field would have been MyT.Sum_Of_Amount.  However, because
this is just a table field, you must use MyT."Sum of Amount". 
Looks strange, but it's the right way to do it.


5.7 When should I use a filter (Order/Range) vs. Query? [WIN]
The Order/Range command and the SwitchIndex and SetFilter methods
let you select an index, then limit the values that can be
presented.  This is extremely fast, but is limited to the current
index order.  If you need to limit records based on values in
fields not in the index, from criteria on more than one table or
non-contiguous ranges, you should base your  form or report on a
query, rather than limiting the range on the table.  Note that if
you use DBase tables, you can use any DBase SELECT statement for
your range expression.  This could make using DBase-format files
worthwhile for some applications.


5.8 Why can't I change data on a detail table? [WIN]
Error Message: Cannot modify table"
By default, all 1-1 detail tables in your data model are set to
read-only except for the master (left-most) table.  In the data
model, right-click on each 1-1 linked table, and un-check the
read-only property.

Error Message: "Symbol table space exceeded" 
This means that you've either used too many variables in your code, 
or that you've got too many objects on your form, or both. 

Solution:
Try reducing the length of the names of the objects, for example, 
"thisisthenameofanobject" to "nameobj", etc. Reduce and/or reuse the 
variables in your code. Move code to libraries which have their own 
seperate limits. Cut the number of objects on your form.


5.9 Why does the Form and Report experts fail to work? [WIN5]
When invoking the Form and Report experts, the following error message is 
displayed: 
		Error Code: peUnassigned
		A Paradox Error occurred.  The message is:
		<no message available>
For these experts to work, you need to have a valid printer installed as 
your default printer. Generic/Text Only and Generic Postscript drivers 
won't work.


5.10 How do I create a report in Paradox for Windows that allows a report to 
	correct problems with decimal alignment with negative numbers? [WIN]

The formula for decimal alignment is as follows:

format("w12.2,ar,s-0,ec,",[DECALIGN.VALUE])+IIF 
([DECALIGN.VALUE]>=0,"","")


5.11 How do I pass variables from one form to another? [WIN]
If one form is opened by another, like a form opening a dialog box, 
the form can set the dialog box's fields directly, for example:

var
  fmDlgBox form
endvar

fmDlgBox.open("DIALOGBX.FSL")   ; whatever form you are opening
fmDlgBox.field1="DEFAULT VALUE" ; whatever value you want, even a 
field
reply=fmDlgBox.wait()           ; wait for the reply
.....

The variable 'reply' will contain whatever value was in 'returnfield'
when you left 'fmDlgBox' with a "fmDlgBox.return(returnfield)" statement. 
You can only pass a single value back to the calling form this way.

If you are trying to pass information between two forms that are NOT
on the desktop at the same time, things gets a bit more complicated.
You basically have four choices:

a) Use a temporary table, preferably in your :PRIV: directory.
Use __TBNAME (two underscores) in front of it so PDOXWIN will delete it
automatically when it exits.  Just use a tcursor to write it and use
another tcursor to read it back.

b) Use DOS environment variables.  You are limited to strings, but 
you can easily convert them back.  Unfortunately, this means you can't 
pass large amounts of information, since free environment space varies 
from computer to computer.

c) Use INI files.  You are limited to strings again, but you have 
64K's worth of space to work in. On the other hand, you have to read them
back in one by one, and it's slow. Remember to write them in your
:PRIV: directory so other forms don't pick it up by mistake.

d) Use library variables.  You will need to write custom library 
proc's to set and access them, but it should be worth it if you have a lot 
of variables (like an array) or exotic data types.


5.12  I am using ODBC drivers.  Why can't I access my Paradox tables? [WIN]
ODBC is a database access standard invented by Microsoft.  
Basically, an ODBC-compliant program can access any type of tables from any
manufacturer as long as the driver for them are present.  The first
release of ODBC, included in Microsoft Office 4.0, included drivers 
for dBase, Paradox, FoxPro, and Access.

Unfortunately, Microsoft did NOT explain clearly that the Paradox 
driver provided can only access V3.5 and earlier tables (the demo that came
with Visual BASIC 3.0 Pro did). Paradox V4.0 and later as well as
Paradox for Windows (any version) use a different table structure.  
ODBC driver ask for a password when it tries to access the new style 
tables.

There are two solutions:
a) If you have access to Paradox for DOS 4.X, you can restructure 
them back to V3.5 style tables.  However, this means you will be missing
several features such as BLOB fields, Memo fields, and so on.  It was
also said that V4.X tables are somewhat faster.

b) Get new ODBC drivers from Microsoft.  You can try the Microsoft 
BBS or ftp.microsoft.com to see if they have it.  You can also call their
customer support department.


5.13 How can I use a Paradox for Windows form to send data to a
	WPWIN 6.0a document? [WIN]
The script launchs wpwin and initiates the DDE conversation.  A 
for...endFor loop is required so that the wpwin macro commands are 
not executed until the DDE link is established.

method pushButton(var eventInfo Event)

var
	[declare variables]
endvar

[initialize variables]

;run wpwin
execute ("c:\\wpwin60\\wpwin.exe", Yes, WinStyleDefault)

flag = "false"

;wait for the DDE link to open before issuing macro commands
for i from 1 to 10
	if ddeLink.open("WPWin60_Macros","COMMANDS") then
		flag = "true"
		quitLoop
	endIf
	sleep(1000) ;wait 1 second and try again
endFor

if flag = "false" then
	;if the dde link never opens (flag = false) then quit the method
	return
endIf
	;open wpwin document with macro command
	ddeLink.execute("FileOpen(\"dde.wpd\")")
	;move the doc's cursor to the place you want to enter text
	ddeLink.execute("BookmarkFind(\"Client Name\")")
	;the placement of the \ and " characters is critical
	ddeLink.execute("Type(\"" + Name + "\")")

ddelink.close()

endmethod


5.14 How do I fix this ASCII printing problem when it occurs? [WIN]
Construct a single Calculated report field for each line. It works,
though it's tedious. For example, suppose you're printing a report from a 
single table named "Tbl", and suppose, in the example above, that AAAAA 
is from "Fld1", BBBBB is from "Fld2", and so forth. Then define a single 
Calculated field for the 1st line as follows: [Tbl.Fld1]+" "+[Tbl.Fld2]+" 
"+[Tbl.Fld3]+" "+[Tbl.Fld4]+" "+[Tbl.Fld5] This works, and PfW's pull-
downs in its Define Field dialog box simplify the chore considerably.

5.15 What is the Borland Database Engine? [WIN]
(From Borland press release)
The Borland Database Engine 2.0 for Windows is comprised of an integrated 
database application programming interface (API) of over 150 functions 
and advanced data integration services including: linked cursors; bi-
directional scrollable cursors; in-memory tables; Binary Large Object 
(BLOb) cache; debugging services; Structured Query Language (SQL) 
support; Query-by-Example (QBE) support; and support for access to Open 
Database Connectivity (ODBC) data sources.  It is optimized for access 
from C, C++ and Pascal programs, although it can be accessed by any 
language capable of making calls to Microsoft Windows Dynamic Link 
Libraries (DLLs).

The Borland Database Engine 2.0 for Windows allows developers to 
simultaneously access multiple database tables on multiple platforms.  
In addition to its native access to Paradox, dBASE and text tables, the 
Borland Database Engine 2.0 is SQL driver-ready.  Native SQL access is 
available to Oracle, Microsoft/Sybase SQL Server, Informix and Borland's 
InterBase data, through Borland SQL Links 2.0 for Windows.  The same 
ease-of-use applies to ODBC data access: the ODBC socket built into the 
Borland Database Engine 2.0 provides seamless connection to third-party 
ODBC drivers, opening up the doors to the widest data access solution 
available from any unified engine technology today. 


5.16 Is there a way to display an entire Memo Field on a form 
so that it's ready for user navigation and editing without 
pressing "Shift-F2"? [WIN]
Put the following code on the field's Setfocus method:

	method setFocus(var eventInfo Event)
	self.action(EditEnterMemoView)
	endmethod
....

-------------------------------------------------------------------------
6.0 FREQUENTLY ASKED QUESTIONS [DOS]

6.1 How does Paradox round numbers? [DOS, WIN]
Paradox uses Banker's Rounding.  This has been found to be
extremely annoying to many people. Banker's Rounding rounds a 5
digit to the nearest even number.  So, ROUND(123.45,1) goes to
123.4, but ROUND(123.55,1) goes to 123.6! (Paradox for Windows
uses the expression variable.Round (digits) for rounding, and
does not seem to 'suffer' from banker's rounding).

Note that the FORMAT() function uses mathematical rounding:
     NUMVAL (FORMAT("W10.1",123.45)) returns 123.5.


6.2 How can I delete an arbitrary file? [DOS]
The most obvious method is to use
	RUN [NOREFRESH] "DELETE "+TheFile
If you have multiple files to delete, you may want to create a
.BAT file and execute that, as the RUN command is somewhat time
consuming.

Another method is to create a new file of the same name using the
Editor, and not save it.  This deletes the original file.  It
will not work properly for non-textual files such as .EXE, .COM
or .SC2.  But it's a neat trick, worth looking at, and faster
than RUN, by as much as 25 times.

(Requires version 4.5):

     EDITOR NEW TheFile                 ; Create a new file
     WINDOW HANDLE EDITOR TO AHandle    ; Get the window handle
     WINDOW SELECT AHandle              ; Select the window
					; (twice in case
     WINDOW SELECT AHandle              ; of floating windows)
     WINDOW CLOSE                       ; Close without saving

Remember not to delete Paradox components using this method
(tables, indexes, forms, reports, etc. etc.) as Paradox may still
have them open, or expect them to be there later.


6.3 What are these *&!# files doing here? [DOS]
Paradox/DOS is somewhat sloppy about leaving PDOXUSRS.LCK and
$PALMEM$ files in directories that you use SETDIR to move to. 
PDOXUSERS.LCK is used to lock records, $PALMEM$ is a swap file
for memo fields.  They can get created, and not deleted, if you
use SETDIR to change directories during a Paradox session.  Using
SETPRIVDIR "C:\SOMEWHER" (a valid path) will ensure that these
files get put *only* there.


6.4 Where's the arrive trigger? [DOS]
Unlike Paradox/Win, ARRIVETABLE, ARRIVEROW and ARRIVEFIELD
triggers do not get sent to a Wait procedure if your procedure
'manually' moved to the new table, row or field.

The solution is to  call your Wait procedure recursively:

     PROC MyWait(TrigType,TheEvent,Cycle)
	SWITCH
	CASE TrigType = "DEPARTFIELD" AND FIELD()="Order Num"
	   DOWNIMAGE
	   MyWait("ARRIVETABLE",TheEvent,Cycle)
	   MyWait("ARRIVEROW",TheEvent,Cycle)
	   MyWait("ARRIVEFIELD",TheEvent,Cycle)
	ENDSWITCH
     ENDPROC


6.5 How do I get the disk drive letters? [DOS]
In Paradox/DOS 4.5, a new command is added for this:

     SYSINFO DRIVES TO DriveArray

DriveArray is a DYNARRAY containing one element for each drive,
in reverse alphabetical order ;^)  Each element contains "SHARED"
for network drives, else "LOCAL".  Note that they include the
colon ("D:").  You may want to use
DRIVESTATUS(SUBSTR(DriveArray[whichDrive],1) to test for an
actually available drive, as the floppies are always listed, as
is a not-ready CD-ROM drive, etc.

-------------------------------------------------------------------
7.0 BUGLISTS/WORKAROUNDS [DOS/WIN]

This future section will contain information on known bugs and 
limitations as well as any workarounds.

-------------------------------------------------------------------
8.0 Paradox 3rd-Party Product Directory

David Sherman <dsherman@freenet.columbus.oh.us> maintains a fairly
exhaustive list/Paradox db listing of 3rd party products and vendors.

## END PARADOX FAQ v2.6 ##



