为什么我不能使用命令“revZipOpenArchive”与移动(IOS)? - livecode

时间:2014-05-26 11:06:14

标签: livecode

我将文件下载到我的路径。我的路径是“文档”。

我在运行时在pc上测试我的代码。它正在工作。但是我在模拟器中测试时没有工作而没有错误信息。

这里代码:

on mouseUp
   put specialFolderPath("documents") & "/testFile.zip" into pFile
   openArchive pFile
   revZipOpenArchive pFile, "read"
   --morecode zip file--
end mouseUp

在命令“revZipOpenArchive”正在运行之前。但它不能正常工作。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

显然,您在模拟器中没有收到错误消息,因为默认情况下,独立站不显示错误消息,当您在模拟器中运行堆栈时,它会作为独立运行。如果要显示错误消息,请更改脚本以包含try控制结构。

on mouseUp
   try
   put specialFolderPath("documents") & "/testFile.zip" into pFile
   openArchive pFile
   revZipOpenArchive pFile, "read"
   --morecode zip file--
   catch myErr
     answer error myErr
   end try
end mouseUp

我敢打赌,LiveCode会报告接近573,5,4,revZipOpenArchive的错误,在此示例中,这意味着您的脚本第5行的第4位出现问题。原因可能是您没有在独立应用程序设置窗口的iOS窗格中包含ZIP外部。请注意,在“独立应用程序设置”窗口的“常规”窗格中包含ZIP外部设备不会这样做,因为这仅适用于桌面独立设备。

要显示所有错误,请使用以下脚本:

on errorDialog theError
  beep
  answer error theError
end errorDialog