Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table not updating
Message
From
01/04/2004 08:50:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Table not updating
Miscellaneous
Thread ID:
00891456
Message ID:
00891456
Views:
59
I have the following code in an application. There is something I don't understand about what is happening. First I create the table and open it with an alias of bv. Then I append a blank record for each pass through the loop depending on the value of m_entries. It the test I have been doing, that value has been 4. You will notice that if there is a blank in the arraay value ary(i,1), I trim the value to drop the characters after the space. I then as part of the replace command store the value of ary(i,1) into the field lcode. For testing I use a messagebox() to view the value of bv.lcode as the message and ary(i,1) as the title of the message box. The title comes out as I expect, but the bv.lcode is always blank. If I browse the bv table at that time, the record has been appended, but no values have been set by the replace.

Any thoughts on what I may be missing in this scenario. I running VFP6 with service pack 5.

Any help would be greatly appreciated.

Alan



if m_entries > 0
m_table = sys(3) && Get a valid name for the table and keep it for delete
create table &m_table FREE ;
(rectype c(1),;
lcode c(9),;
coding_not m,;
hcfa_descr c(254),;
sps_direct c(20),;
vendno n(5),;
vendor c(100),;
product_nu c(50),;
product_na c(250),;
list_price n(20,5),;
hpo_price n(20,5),;
note_1 c(254),;
note_2 c(254),;
add1 c(35),;
add2 c(35),;
city c(25),;
state c(2),;
zip c(10),;
phone c(14),;
fax c(14),;
web c(50),;
qty n(3,0),;
fabnote c(254),;
shrtsing c(79),;
dfltbv c(240),;
wkshtnot c(254),;
NOCedit l)
* Record type master=M, Price=P and Vendor=V
use &M_table alias bv exclusive && Use the table as bv
index on lcode tag lcode
set relation to dfltbv into dfltbv
if used('master')
select master
else
select 0
endif
use master order hcpc
if used('pricing')
select pricing
else
select 0
endif
use pricing order hcpc
if used('vendor')
select vendor
else
select 0
endif
use vendor order vendno
for i = 1 to m_entries && Build each of the entries into the table
select bv
append blank
m_elen = at(' ',ary(i,1)) && check for a space found()
if m_elen > 0
ary(i,1) = substr(ary(i,1),1,m_elen-1) && trim to the first blank
endif
* replace lcode with alltrim(upper(substr(ary(i,1),1,5))),; && *******
replace lcode with alltrim(upper(ary(i,1))),; && *******
qty with ary(i,2),;
fabnote with space(0),;
dfltbv with alltrim(upper(ary(i,1))),;
NOCedit with ary(i,4),;
hcfa_descr with alltrim(ary(i,3))
=messagebox(bv.lcode,16,ary(i,1))

Next
Reply
Map
View

Click here to load this message in the networking platform