OK, belay that last message from me... I'll continue with this
thread...
Frank: I know the code is crappy, but I didn't write it, I'm only the
caretaker. :)
David: Thanks so much for your help... you've helped me many times in
the past.
I took your advice and created a folder in the root of C: on the
handheld to contain the application. The folder is called "HANDHELD".
I then added the following to the main calling program:
set default to C:\HANDHELD
set path to C:\HANDHELD
I then removed any specific references to C:\ in the program. For
example:
use c:\SCANFILE.DBF index C:\SCANFILE.NDX alias SCANFILE
now reads:
use SCANFILE.DBF index SCANFILE.NDX alias SCANFILE
But, that didn't help with my problem.
The issue seems to be with writing to .DBF files.
In a part of the application, it writes records to a database file. I
wrote a few records and then exited the program. I then attempted to
open the file on the handheld device using Advantage Data Architect,
and it failed to open the file with an error message that said "The
table contains more or less records than specified in the table
header." (Using ADA to open other database files that I haven't tried
to write to works OK.) I then copied that file to my PC and it opened
with no error, but the file was empty. So, the problem lies with
writes to .DBF files somehow, or possibly with how DOS is handling the
file tables. (Reading from .DBF files isn't an issue... I have a
program that verifies item numbers by accessing a master file of items
in a .DBF file and that works just fine.)
To eliminate a problem with writes in general, I wrote a program that
wrote directly to a text file. Here is the code:
set default to C:\HANDHELD
set path to C:\HANDHELD
cTEXT = memoread( "SCOTT.TXT" )
cNEWTEXT = stuff( cTEXT, 1, 4, "CHANGE" )
memowrit( "SCOTT2.TXT", cNEWTEXT )
I was able to open 'scott2.txt' just fine on the handheld and it
contained the data I was expecting. So, there doesn't seem to be a
problem with writes in general, but only with writes to .DBF files.
Here is my compile script:
Clipper C:\Handheld\%1 -oc:\Handheld > errors.txt
IF NOT ERRORLEVEL 1 BLINKER FI C:\Handheld\%1 @c:\CLIPS87\BCL.LNK <
C:\Handheld\C.TXT
IF NOT ERRORLEVEL 1 DEL C:\Handheld\%1.OBJ
Here is my link script:
BLINKER INCREMENTAL OFF
BLINKER EXECUTABLE CLIPPER F45
#
BLINKER CACHE XMS 1024, 25%
BLINKER CACHE EMS 1024, 25%
BLINKER OVERLAY FIXED
#
BEGINAREA
#
#LIB \CLIPS87\EXTEND
#LIB \CLIPS87\NANFOR
#
ENDAREA
#
FILE \CLIPS87\NDX
@\BLINKER\CLP\LNK\CL87MID.LNK
I'm not sure what I can add/change here to affect writing to .DBF
files. Keep in mind that the applicatin has worked on two different
generations of handheld devices, as well as on my test box. Since the
only different variable here is (in theory) the version of PocketDOS
I'm using on the Windows CE device, it would seem that the problem is
there, rather than with the code or compiler. But I can't think of
any DOS configuration change that might help here. Here are my
autoexec.bat and config.sys files:
autoexec.bat:
cls
rem -----
rem The following line sets the DOS PATH
rem -----
PATH A:\DOS
rem ----
rem Display drive settings (for information only)
rem Type: SETDRIVE /? for more information.
rem Note: SETDRIVE must be run from AUTOEXEC.BAT to enable saved
redirections
rem ----
SETDRIVE NOBANNER
echo.
C:
cd handheld
main.exe
********************************
config.sys:
rem ----
rem Load File System Redirector
rem ----
DEVICEHIGH=\DOS\PKTDOSFS.SYS
rem ----
rem Load Expanded Memory (LIM EMS 3.2) Driver
rem ----
DEVICEHIGH=\DOS\EMSMEM.SYS
Sorry for the wall of text... just trying to provide all relevant
info.
Thanks