Hi
In 1999 I wrote a program which has 2 tables. The first keeps track of
clients and the second table, linked to the first keeps track of the
visits that each client makes. In the table structure the character
width of the c_code (unique client number) is 10, in the visit table
the order_no character width is set to 8. Stupidly when I wrote the
program I only used a STR() <length expN> of 4. The code is below for
your perusal. Now what happens is that as we're at 9999 visits when
the prog ads 1 it gets 10000 and the STR() displays **** as the length
expN is smaller.
Procedure newvisitbutton_OnClick
set century on
form.tabbox1.enabled=.f.
this.enabled=.f.
select client
if eof()
return
endif
select select()
visitdbf=gprogdir+"visit.dbf"
use &visitdbf again alias temp
set order to order_no
goto bottom
orderno=val(temp->order_no)+1
use
strorderno=str(orderno,4,0)
select visit
form.beginappend()
replace visit->order_no with strorderno
form.spinbox1.value = date()
form.orthotistentry.setfocus()
I've tried to change this by altering the 4 to 6 or 8 etc. but the
visit number just doesn't add. What can I do?
Please help.
Cameron