[問題] InDesign的js

看板Ajax作者 (poototo)時間12年前 (2011/09/25 18:43), 編輯推噓2(206)
留言8則, 3人參與, 最新討論串1/2 (看更多)
1. for loop的其中一輪其中一行,若發生錯誤 如何該行以下不執行,直接跳下一輪 用break會跳出整個迴圈 2. 有可能檔頭直接下指令,強迫遇到錯誤仍往下執行嗎? VBA是有On Error Resume Next這種指令 Thx 0925 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.200.42.110

09/26 08:02, , 1F
continue ?
09/26 08:02, 1F

09/26 20:38, , 2F
try...catch 可以無視錯誤
09/26 20:38, 2F

09/26 23:29, , 3F
try catch 跟 on error resume next 有點落差
09/26 23:29, 3F

09/26 23:30, , 4F
js 裡面是沒有等價 on error resume next 的描述的
09/26 23:30, 4F

09/26 23:30, , 5F
除非你每一行包 try catch
09/26 23:30, 5F

09/26 23:31, , 6F
for loop那個問題 關鍵字是 continue;
09/26 23:31, 6F

09/27 08:10, , 7F
可以在最外層放一個 try...catch可以實現on error resume.
09/27 08:10, 7F

09/27 11:42, , 8F
on error resume 跟最外層放try catch不一樣
09/27 11:42, 8F
文章代碼(AID): #1EVmNJps (Ajax)
討論串 (同標題文章)
文章代碼(AID): #1EVmNJps (Ajax)