9.9.4 SetTrialOpenMode (set the trial-open function)
- Purpose
-
Sets the trial-open function.
- Syntax
SetTrialOpenMode ( Count [,WaitTime])
- Arguments
-
- Count
-
Specify the trial-open retry count as a number in the range from 0 to 100, or as a variable that stores this value.
If you specify 0, the trial-open function is canceled.
- WaitTime
-
Specify the trial-open retry interval as a number (milliseconds) in the range from 100 to 60,000, or as a variable that stores this value.
This value is optional. If you omit this value, 100 is assumed.
- Description
-
The SetTrialOpenMode command tries to open a file if a lock error occurs during an attempt to open a file that was closed by the TextClose command.
The specified trial-open retry count and trial-open retry interval are effective until the ResetTrialOpenMode command is executed.
- Example
Dim file1, Buff1 file1 = TextOpen( _BIN_ + "Error.log", ReadWrite ) If file1 = 0 Then MessageBox( _BIN_ + "Failed to open", OK ) Exit 2 End If TextSeek( file1, ToEnd ) TextWrite( file1, "A lock error occurred." ) SetTrialOpenMode( 2, 6000 ) ' Set trial-open. TextClose( file1 ) ' Disk write might delay ResetTrialOpenMode ' Cancel trial-open. Exec( "MessageOutput.EXE", True, _BIN_ + "Error.log" )
- JP1/Script version
-
Supported from JP1/Script 10-00.