I am working my way through some old DOS programs and converting them to run in a windows 32/64 bit enviroment.
One program that I'm working on fixes any rogue rogue records in a database. It checks for blanks, duplicates and broken relationships and reports them in a log file and can fix them depending which option is selected.
I'm using HMG IDE Unicode 1.0.8 to compile into 32 bit. (64 bit won't compile at all, it just freezes HMG and has to be forced closed)
The program I'm converting currently works perfectly when run from dos in an XP or lower environment, but unfortunately this program falls over when run after being compiled in HMG.
The problem is the "ALLTRIM" function which is referred to several times in my program. It is critical that leading and trailing spaces are removed from records, as well as carriage returns etc. The record should just comtain the characters and nothing more.
My thought was to try to use LTrim, then RTrim on the same string before further processing, but i'm stuck with the syntax.
Can somebody please advise how i can do that in clipper? Here is some of my code.
Code: Select all
procedure blanks()
select 1; use blank.dbf
message(3,opy,mess,"Blank and Invalid Codes")
do while !eof()
vfile=file; vfield=field; vsize=size
message(4,filey,mess,"Deleting "+(vfile))
select 2; use &vfile; setbar()
hold=4
do while !eof()
progress(recno(),lastrec())
if len(alltrim(&vfield))<vsize
//if len(alltrim(&vfield)) <-- how to use alternative to ALL TRIM?
errortofile("Blank/Invalid",vfile,recno())
if upper(delrep)="D"
delete
endif
endif
skip
enddo
select 1
skip
enddo
close 1; close 2