Discussion:
expression error ( in index key )
(too old to reply)
Scott Coffey
2024-02-19 18:28:53 UTC
Permalink
Hoping for a minor miracle here...

I have a Clipper application running on a handheld device (Pocket PC).
I'm using PocketDOS as the OS on the handheld device. I'm trying to
port this application to a handheld running Windows CE 7.0. Although
I had some issues installing PocketDOS on the Windows CE device (was
unable to use the installer and had to install manually), I got it
installed and am able to launch and run the Clipper application on
this device.

The application runs fine until I try to create an index, then the
application fails when I try to use that index.

Example:

Program A uses the following statement:

use c:\SCANFILE.DBF index C:\SCANFILE.NDX alias SCANFILE

That works fine as long as I'm using the original index created on the
old Pocket PC handheld. Then I have a program that does:

if file( "SCANFILE.DBF" ) = .T.
if file( "SCANFILE.NDX" ) = .T.
erase ("SCANFILE.NDX")
endif
use SCANFILE.DBF
index on ITEM to SCANFILE.NDX
endif

That runs OK, but the next time I try to run program A, it fails on
the "use" statement with the error: "expression error ( in index key
)"

The database files and indexes were copied from the working device to
the new device. As stated, accessing the database files via the index
works OK initially, but when I try to recreate the index the program
then fails as described. If I re-copy the files, the program works
again until I try to recreate the index.

Any ideas out there?
--
Scott at Scott dash(-) Coffey dot net
Enrico Maria Giordano
2024-02-19 18:37:30 UTC
Permalink
Are you using xHarbour or Clipper?
--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg
Scott Coffey
2024-02-20 13:27:35 UTC
Permalink
On Mon, 19 Feb 2024 19:37:30 +0100, Enrico Maria Giordano
Post by Enrico Maria Giordano
Are you using xHarbour or Clipper?
Clipper S87.
--
Scott at Scott dash(-) Coffey dot net
Dlzc
2024-02-20 15:42:35 UTC
Permalink
Post by Scott Coffey
Post by Enrico Maria Giordano
Are you using xHarbour or Clipper?
Clipper S87.
It seems that the new index is not identical to the old one. Check the
index type (NDX/NTX/...) and the index key.
S'87 manual Appendix F says the they "key" is damaged. I wonder if the executing program and indexing program are using the same version of compiler and libraries?

David A. Smith
Dlzc
2024-02-21 14:33:07 UTC
Permalink
OK, after doing some additional research, it appears there's a problem
with databases in general.
...
Do any of you oldsters out there know of any DOS tweaks that might
cls
rem -----
rem The following line sets the DOS PATH
rem -----
PATH A:\DOS
... note the path.
DEVICEHIGH=\DOS\PKTDOSFS.SYS
So you are instructing the OS to look in A:\DOS\DOS\... for that particular program. Why don't you display line by line (as makes sense) any error messages that you might be ignoring from instructions to 'DOS'?
DEVICEHIGH=\DOS\EMSMEM.SYS
... ditto
Any ideas/suggestions are appreciated.
Before first line of executing code, add a diagnostic. Run DIR and wait, or run ADIR() and analyze. See where the code is looking for database and index. Alternatively, issue a SET DEFAULT to the druive and directory you want it to look in. Do this same thing for the code that (re)creates the index, or incorporate in the one program. S'87 had some limited error trapping, could put the code there.

David A. Smith

Loading...