>Great. I've worked your code into the material that I have, Cetin, and it works very well. I've gone ahead and created a browse of the information and that isn't working quite well yet, but it's almost there. If you have any suggestoins, please let me know. I know that you've already given me more help than I would have ever expected, but these problems appear to be quite trivial to you. ;) After I close the browse, I get an error saying that 'no table is in use'. Here it is and thanks for the help:
>
>scatter memvar memo
>insert into (m_proj+"PA") from memvar
>skip
>show gets
>close data
>use (m_proj+"PA") alias PA
>sele PA
>go bottom
>browse
>close data
>use (m_proj+"SP") alias SP in 0
>sele SP
>skip
>show gets
Thierry,
I think it's not just this part of code causing the error. Seems you have controls referring to other tables on screen. When you "close data" and call "show gets" (it's the point of error I think) it would complain as "no table is in use" or similar.
In code, what does first "skip" and "show gets" do ? Seems to me useless there because an immediate "close data" follows. Further, after insert into (m.proj+"PA") is opened if not already. Why "close data" and then use it ? I advise not to use "close data" so often. Generally leave it to cleanup of screen. With the existence of structural indexes (cdx) you have plenty space for file handles, instead of close data, you could just "flush" or "set autosave on" if you're doing this against data corruption (set autosave is less safe then flush). If you're doing it to switch the tables then just call -use (m.proj+"PA") in "PA" alias "PA"-. Now after all these I would code it like :
scatter memvar memo
insert into (m_proj+"PA") from memvar
skip
show gets
use in (m_proj+"PA")
if used("PA")
use (m_proj+"PA") in "PA" alias "PA"
else
use (m_proj+"PA") in 0 alias "PA"
endif
sele PA
go bottom
browse
use (m_proj+"SP") alias SP in 0
sele SP
skip
show gets
Well afterall, keep in mind, touching partial code might mess up things worse :) Just try to do it w/o close data on the fly.
Cetin