Insert into lv_veh(v_no) value (alltrim(.txtv_no.value))However, I tried you example, and the array returned a 0 for v_id. v_id is an integer value that is primary key in my table. I know the record was wrote because a nextid.prg file assigns unique integer number everytime I insert into my table for v_id. I went through that code in during insert by using the debugger. The reason why I used alltrim was because
.txtv_no.value had spaces like this 'H 'and
lv_veh.v_id had spaces like this 'H 'Since I was using == to compare, I though I should keep both sides same.
select lv_veh.v_id FROM lv_veh WHERE ALLTRIM(lv_veh.v_no) == ALLTRIM(m.vno) into array a__gen2 mx = lv_veh.v_id mz = lv_veh.v_no mp = lv_veh.v_vinmx return 0 && which is incorrect should be 152
>>cursorsetprop('sendupdates', .T.,'lv_veh') >>Insert into lv_veh(v_no) value (alltrim(.txtv_no)) >>tableupdate(.t., .t., 'lv_veh') >>vno = alltrim(.txtV_no.value) >>select lv_veh.v_id FROM lv_veh WHERE ALLTRIM(lv_veh.v_no) == ALLTRIM(vno) into array a__gen2 >>>
>Insert into lv_veh(v_no) values (.txtv_no.value) >tableupdate(.t., .t., 'lv_veh') >vno = .txtV_no.value >select lv_veh.v_id ; > FROM lv_veh ; > WHERE lv_veh.v_no == m.vno ; > into array a__gen2 >if _Tally > 0 > wait window 'Worked '+trans(a_gen2) >endif>PS: You don't need alltrim unless it's for left trimming.