SuperCard 编程/提示与技巧/堆栈作为文档模板
外观
< SuperCard 编程 | 提示与技巧
一种方法是将模板存储为用户属性,并在需要新文档时将其写出。
storeDoc 在您准备应用程序时运行一次
on storedoc answer file "Choose a template to use:" if it is "" then exit storeDoc put it into tFile open file tFile read from file tfile until end close file Tfile define the UDoc of this proj set the uDoc of this proj to it end storeDoc
newDoc 在您需要新文档时运行
on newDoc ask file "Name your doc:" if it is "" then exit newDoc put it into tFile put the fileType into toldType set the fileType to RUNXMDOX --Or your standalone's creator and file Type open file tfile write the uDoc of this proj to file tfile close file tfile set the fileType to toldType set the itemdel to colon put last item of tfile into tWindowName set the name of wd 1 of proj tFile to tWindowName open proj tFile end newDoc
对于捆绑应用程序,也可以将模板存储在捆绑包中的某个位置,并在需要新项目时将其复制出来。
显然,如果您想打开一个无标题文档,该文档类似于标准文档并需要显式保存,则事情会变得更加复杂。
Keith 对 Graham Samuel 关于独立应用程序的笔记进行了更新:[[1]]