DIAdem API Reference

Command: ExecuteExclusiveEnd

  • Updated2023-02-21
  • 2 minute(s) read

Display all  Hide all

Ends the execution a mutually exclusive script section. If an instance is terminated, the execution of a mutually exclusive script section is automatically released to the other instances.

Call ExecuteExclusiveEnd(ExecuteExclusiveHandle)

Input Parameters

ExecuteExclusiveHandle Specifies the handle for executing a mutually exclusive script section.

Examples

The following example starts executing a mutually exclusive script section to open a file and write to that file. If it is not possible to execute a mutually exclusive script section after ten seconds, this DIAdem instance aborts execution with a debug message.

VBScriptPython

 

Dim intExecuteExclusiveHandle, intMyFileHandle, intMyError
intExecuteExclusiveHandle = ExecuteExclusiveBegin("WriteFile",10) 
If intExecuteExclusiveHandle < 0 Then 
  Call DBM ("Timeout: Could not write file")
Else
  intMyFileHandle =  TextFileOpen(CurrentScriptPath & "MyFile.txt", eTextFileAttributeExclusive OR eTextFileAttributeWrite OR eTextFileAttributeANSI)
  Call TextFileWriteln(intMyFileHandle,"Test")
  intMyError = TextFileClose(intMyFileHandle)
End If
Call ExecuteExclusiveEnd(intExecuteExclusiveHandle)

Related Topics

Command: ExecuteExclusiveBegin | Command: ExecuteExclusiveEndAll