File: mutex.sra
Size: 911
Date: Sat, 09 Feb 2019 22:43:26 +0100
$PBExportHeader$mutex.sra
forward
global type mutex from application
end type
global transaction sqlca
global dynamicdescriptionarea sqlda
global dynamicstagingarea sqlsa
global error error
global message message
end forward

global variables

end variables

global type mutex from application
string appname = "mutex"
end type
global mutex mutex

on mutex.create
appname="mutex"
message=create message
sqlca=create transaction
sqlda=create dynamicdescriptionarea
sqlsa=create dynamicstagingarea
error=create error
end on

on mutex.destroy
destroy(sqlca)
destroy(sqlda)
destroy(sqlsa)
destroy(error)
destroy(message)
end on

event open;n_mutex ln_mutex

// check for previous instance of exe
If ln_mutex.of_apprunning() Then
   MessageBox("Mutex Example", &
      "Only one copy of the application is allowed!", &
      StopSign!)
   Halt
End If

Open(w_main)

end event