Skip to content

Commit c3ef13b

Browse files
authored
Update 004-FileViewerDemo_Loop.au3
1 parent ebfc766 commit c3ef13b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

examples/004-FileViewerDemo_Loop.au3

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ Func _Example()
6767
Local $bSleep_UserReaction = ($IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, "Question", "Simulates user reaction on PDF (2 sec sleep) ?"))
6868

6969
Local $a_Files = _FileListToArrayRec($s_PDF_Directory, '*.pdf', $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)
70-
Local $sProgress = ''
71-
For $IDX_File = 1 To $a_Files[0]
72-
$sProgress = '[ ' & $IDX_File & '/' & $a_Files[0] & ' - ' & Round($IDX_File / $a_Files[0], 5) * 100 & ' % ]'
73-
74-
$s_PDF_FileFullPath = $a_Files[$IDX_File]
75-
GUICtrlSetData($idLabelStatus, $sProgress & ' - Navigation started: ' & $s_PDF_FileFullPath)
76-
_NetWebView2_NavigateToPDF($oWebV2M, $s_PDF_FileFullPath, '#view=FitH', 1000)
77-
GUICtrlSetData($idLabelStatus, $sProgress & ' - Navigation completed: ' & $s_PDF_FileFullPath)
78-
ConsoleWrite("! === @SLN=" & @ScriptLineNumber & ' ' & $s_PDF_FileFullPath & @CRLF)
79-
If $bSleep_UserReaction Then Sleep(2000) ; simulates user reaction on PDF
80-
Next
70+
If Not @error Then
71+
Local $sProgress = ''
72+
For $IDX_File = 1 To $a_Files[0]
73+
$sProgress = '[ ' & $IDX_File & '/' & $a_Files[0] & ' - ' & Round($IDX_File / $a_Files[0], 5) * 100 & ' % ]'
74+
75+
$s_PDF_FileFullPath = $a_Files[$IDX_File]
76+
GUICtrlSetData($idLabelStatus, $sProgress & ' - Navigation started: ' & $s_PDF_FileFullPath)
77+
_NetWebView2_NavigateToPDF($oWebV2M, $s_PDF_FileFullPath, '#view=FitH', 1000)
78+
GUICtrlSetData($idLabelStatus, $sProgress & ' - Navigation completed: ' & $s_PDF_FileFullPath)
79+
ConsoleWrite("! === @SLN=" & @ScriptLineNumber & ' ' & $s_PDF_FileFullPath & @CRLF)
80+
If $bSleep_UserReaction Then Sleep(2000) ; simulates user reaction on PDF
81+
Next
82+
EndIf
8183

8284
; Main Loop
8385
While 1

0 commit comments

Comments
 (0)