如何获取revZip来创建文件并将项目添加到存档?

时间:2014-07-14 15:49:20

标签: livecode

这是我用来测试/学习revZip库的简单处理程序。 fld" XML"包含XML作为文本。 我无法看到错误......有什么想法吗?

command SaveIssue
    put fld "XML" into tXML
    ask file "Save as:" with "NewIssue.zip" as sheet; CheckResult the result
    put it into tPath
    revZipOpenArchive tPath, "write"; CheckResult the result
    revZipAddItemWithData tPath, "issue.xml", tXML; CheckResult the result
    revZipCloseArchive tPath; CheckResult the result
end SaveIssue

command CheckResult tResult
   if tResult is not empty then
      if tResult is "Cancel" then exit to top
      answer "Error:" && tResult
      exit to top
   end if
end CheckResult

1 个答案:

答案 0 :(得分:1)

我在旧论坛帖子中找到了答案。 revZip外部需要围绕变量名称的引号。有点奇怪,但是对这一行的改动修复了它:

revZipAddItemWithData tPath, "issue.xml", "tXML"