I am working in VFP 6.0 and there isn't any possibility to select some data from table to cursor with SQL statment and then update this cursor.
So I wrote this function that makes from noeditable cursor editable cursor:
function r2rw(aCursor)
local i, cFname, nSize, cType, cField
select * from &aCursor into cursor tmp_cursor
select &aCursor
use in &aCursor
create cursor &aCursor(xdc I)
select "tmp_cursor"
for i=1 to fcount()
cFname=field(i)
cType=type(cFname)
nSize=fsize(cFname)
cField=right(cFname,10)+" "+cType+"("+trans(nSIze)+"
"
select &aCursor
alter table &aCursor add column &cField
select "tmp_cursor"
endfor
alter table &aCursor drop column xdc
select * from tmp_cursor into array tmp_array
insert into &aCursor from array tmp_array
select &aCursor
for i=1 to fcount()
cFname=field(i)
index on &cFname tag &cFname
endfor
endfunc
So I wrote this function that makes from noeditable cursor editable cursor:
function r2rw(aCursor)
local i, cFname, nSize, cType, cField
select * from &aCursor into cursor tmp_cursor
select &aCursor
use in &aCursor
create cursor &aCursor(xdc I)
select "tmp_cursor"
for i=1 to fcount()
cFname=field(i)
cType=type(cFname)
nSize=fsize(cFname)
cField=right(cFname,10)+" "+cType+"("+trans(nSIze)+"
select &aCursor
alter table &aCursor add column &cField
select "tmp_cursor"
endfor
alter table &aCursor drop column xdc
select * from tmp_cursor into array tmp_array
insert into &aCursor from array tmp_array
select &aCursor
for i=1 to fcount()
cFname=field(i)
index on &cFname tag &cFname
endfor
endfunc