Description
Deletes the specified text from the article.
Available in Ted and Fred.
Syntax
object.DelTxt (nIdx,bSpike, bNotRemoveIfLinked) |
object
Required. Object name. Returned by Ted.GetActiveArticle, or Fred.GetActiveArticle, e.g. dim objarticle = Ted.GetActiveArticle or dim objarticle = Fred.GetActiveArticle.
nIdx
Index of the text to close, ranging from 0 = first text in the article to NTxts-1 = last text in the article. If nIdx is outside this range a run-time error is raised. To get the idx of the current element, use GetCurTxtIdx.
bSpike
If the text already exists in the database (i.e. is not a new text) when the article is saved and bSpike is true it is spiked; if bSpike is false it is only unlinked from the article.
bNotRemoveIfLinked
If the text is linked to a page, and the parameter is true, the text is not unlinked, even if bSpike is false.
Remarks
The user is prompted for a confirmation.
Examples
When a text is selected in the article tree, this script prompts you for the confirmation, and then, if confirmed, unlinks the text from the article. The text is not spiked. Note: nothing happens if the text is linked to a page.
If Ted.HasActiveArticle Then dim objArticle = Ted.GetActiveArticle objArticle.DelTxt (objArticle.GetCurTxtIdx,False,True) End If |
When a text is selected in the article tree, this script prompts you for the confirmation, and then, if confirmed, unlinks the text from the article. The text is spiked. Note: nothing happens if the text is linked to a page.
If Ted.HasActiveArticle Then dim objArticle = Ted.GetActiveArticle objArticle.DelTxt (objArticle.GetCurTxtIdx,True, True) End If |
Context
Article object
See also