首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在livecode中保留文本内容

如何在livecode中保留文本内容
EN

Stack Overflow用户
提问于 2015-04-09 12:32:28
回答 1查看 71关注 0票数 0

我需要在开始{text}之前和end{text}.If之后保存内容,我有两个名为“保存”和“恢复”的按钮。如果我单击“保存”按钮,上面的整个文本将开始{ text },在end{text}之后将复制到某个txt文件。编辑后,如果单击“还原”按钮,保存的整个文档将位于相同的位置。有可能吗?我正在使用这个代码来替换

代码语言:javascript
复制
put the htmlText of field "MytextField" into myHtml
  set the caseSensitive to true
replace searchStr with  "<strike><font bgcolor=" & quote & "yellow" & quote & ">" & searchStr & "</font></strike><font bgcolor=" & quote & "green" & quote & ">" & replaceStr & "</font>" in myHtml
 set the htmlText of fld "MytextField" to myHtml

在“开始前”{text}和“结束”{text}之后,我没有任何编辑。这样我就能节省时间和准确性

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-19 20:54:40

也许你是在找这个:

代码语言:javascript
复制
put the htmlText of field "MytextField" into myHtml
put offset("begin{text}",myHtml) into startchar
put offset("end{text}",myHtml) into endchar
put char startchar to endchar of myHtml into text_to_preserve
put char 1 to (startchar - 1) into text_toEdit1
put char (endchar + 1) to -1 into text_toEdit2
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29538587

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档