home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
database
/
pdx_ti2.arj
/
TI788.ASC
< prev
next >
Wrap
Text File
|
1992-08-12
|
4KB
|
133 lines
PRODUCT : Paradox NUMBER : 788
VERSION : 3.5
OS : DOS
DATE : August 12, 1992 PAGE : 1/2
TITLE : Converting Numeric Data from Earlier Paradox Versions
One of the major improvements of Paradox 3.5 over earlier
versions of Paradox is the use of the Turbo C math library. This
library provides greater precision and compatibility across other
products than the one used in earlier versions of Paradox.
However, this will cause some numeric and dollar values that were
entered using an earlier version of Paradox to be stored
differently in Paradox 3.5.
Some symptoms of a number being stored or rounded differently are
LOCATE and ZOOM commands returning the message "No Match Found".
Other symptoms are Find or multi-table queries that link on a
numeric field that do not produce expected results. Data entered
via keyboard into Paradox 3.5 should not exhibit these symptoms
(Because of the way computers store numbers, there will always be
occasional roundoff errors when manipulating numbers with many
decimal digits of precision. Unfortunately, other methods of
representing numbers also have disadvantages.)
You can round your numeric data in a uniform manner with one or
both of the following methods. Both involve the translation of
the existing data to an alphanumeric value and the retranslation
back into a Paradox Numeric field.
The first method is to export the existing Paradox file to an
ASCII file, then import the data back into Paradox 3.5. This
method is appropriate if there are many tables or a table with
many fields to correct. (See Paradox 3.5 Readme File for
complete instructions.)
The second method is to run a short PAL script to correct the
numeric values in the table. This method is more appropriate if
there are few tables with few fields to correct. Use the script
editor to write the PAL script for the second method.
From the Paradox Main menu choose {Scripts} {Editor} {Write} and
provide a new script name. This script will correct Numeric
field values through the use of the NUMVAL and STRVAL functions.
Combined they perform similar steps as a complete export to ASCII
and import from ASCII. In the script Replace TableName with the
name of the table and replace FieldName with the name of the
field to be corrected. The Field to be corrected MUST be a
Numeric field.
PRODUCT : Paradox NUMBER : 788
VERSION : 3.5
OS : DOS
DATE : August 12, 1992 PAGE : 2/2
TITLE : Converting Numeric Data from Earlier Paradox Versions
; Script Begins
COEDIT "TableName"
SCAN
IF NOT ISBLANK([FieldName])
THEN [FieldName] = NUMVAL(STRVAL([FieldName]))
ENDIF
ENDSCAN
DO_IT!
; Script Ends
It is possible to convert more than one field at a time. Simply
insert additional lines inside the SCAN and ENDSCAN commands for
each field that need conversion. So a script that converted two
fields would have lines that look like this (where both fields
MUST be Numeric):
; Script Begins
IF NOT ISBLANK([FieldName]) THEN
[FieldName] = NUMVAL(STRVAL([FieldName]))
ENDIF
IF NOT ISBLANK([FieldName 2]) THEN
[FieldName 2] = NUMVAL(STRVAL([FieldName 2]))
ENDIF
; Script Ends
Press <F2> to save this script. To run the script choose
{Scripts} {Play} from the main menu and select your script.
After performing either of these two methods, the values in will
appear on screen to be unchanged, yet a ZOOM, LOCATE, FIND query,
or linking query operation will now produce the desired results.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.