KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to avoid creating a duplicate process
PRODUCT: 4D | VERSION: 2003.3 | PLATFORM: Mac & Win
Published On: May 13, 2004

Compatibility: Version 6.8.x and 2003.x

To avoid creating a duplicate process, you should always make sure that the process with the same name doesn't already exist.

Here is an example method that will check to see if the process with same name does not exist. If a process with the same name is found, then it will be brought to the frontmost process. Otherwise, a new process will be created.

` Project Method: Create_Process
` Usage: Create_Process("MethodName";32000;"ProcessName")
C_TEXT($1;$3;$MethodName;$ProcessName)
C_LONGINT($2;$StackSize;$procid)
$MethodName:=$1
$StackSize:=$2
$ProcessName:=$3
$procid:=New process($MethodName;$StackSize;$ProcessName;*)
BRING TO FRONT($procid)