spartacus
28th July 2003, 18:43
I did the following:
- created a new text
- add this text as item text to an item (in Baan ERP)
- then I tried a text.delete(), to see, if it is possible to delete a text, which is in use. Used the following code:
|*** Function Call ***
diagnose = absstdll0010.delete.text(3272860)
message(str$(diagnose))
commit.transaction()
|*** The function in a DLL ***
function extern long absstdll0010.delete.text(domain tcmcs.long i.txt)
{
long ret
ret = -2
select tttxt001.*
from tttxt001
where tttxt001._index1 = {:i.txt}
selectdo
ret = text.delete("tttxt001.ctxt", "") |delete Text in all Langages
if ret >= 0 then
select absst230.*
from absst230 for update
where absst230._index2 = {:tttxt001.ctxt}
selectdo
db.delete(tabsst230, db.retry)
endselect
endif
endselect
return( ret )
}
This code retrurns me a "-1" what means error.
If I now open the text editor from the item maintenance, I see an empty text.
After closing the the text editor, just closing, do nothing, I can run my little programm and it returns a "0" what means success.
So "text.delete" deleted a text which is used. But more strange, it needs to tries to do that.
Between all that a checked the tables tttxt001, tttxt002 and tttxt010:
- after the first try to delete the text I found the textnumber deleted in tttxt002 and tttxt010.
- after I opend / closed the texteditor, tried my little programm the second time, also tttxt001 was empty.
Spartacus
- created a new text
- add this text as item text to an item (in Baan ERP)
- then I tried a text.delete(), to see, if it is possible to delete a text, which is in use. Used the following code:
|*** Function Call ***
diagnose = absstdll0010.delete.text(3272860)
message(str$(diagnose))
commit.transaction()
|*** The function in a DLL ***
function extern long absstdll0010.delete.text(domain tcmcs.long i.txt)
{
long ret
ret = -2
select tttxt001.*
from tttxt001
where tttxt001._index1 = {:i.txt}
selectdo
ret = text.delete("tttxt001.ctxt", "") |delete Text in all Langages
if ret >= 0 then
select absst230.*
from absst230 for update
where absst230._index2 = {:tttxt001.ctxt}
selectdo
db.delete(tabsst230, db.retry)
endselect
endif
endselect
return( ret )
}
This code retrurns me a "-1" what means error.
If I now open the text editor from the item maintenance, I see an empty text.
After closing the the text editor, just closing, do nothing, I can run my little programm and it returns a "0" what means success.
So "text.delete" deleted a text which is used. But more strange, it needs to tries to do that.
Between all that a checked the tables tttxt001, tttxt002 and tttxt010:
- after the first try to delete the text I found the textnumber deleted in tttxt002 and tttxt010.
- after I opend / closed the texteditor, tried my little programm the second time, also tttxt001 was empty.
Spartacus