` SelfStart
` Used to cause the calling method to re-run in a new Process
` $1 - Process name
` $2 - Method name (If not passed, the same as the process name)
` $3 - Delay in tics. In case you want to delay the new process a bit before
` running.
` Example:
` If (SelfStart (Current method name;Current method name))
` Do some stuff
` End if ` SelfStart
C_TEXT($1;$2;$NewProcessName;$ProcessName)
C_LONGINT($3;$Delay;$ProcessState;$ProcessTime;$Loop)
C_BOOLEAN($0;$Go;$Done)
$NewProcessName:=$1
If ($NewProcessName>"!")
If (Count parameters>=2)
$MethodName:=$2
Else
$Loop:=0
$Done:=False
$MethodName:=$NewProcessName
Repeat ` Find out if the Process name starts with a non-letter designation
If (Position($MethodName[[1]];"abcdefghijklmnopqrstuvwxyz")>0)
$Done:=True
Else
$MethodName:=Substring($MethodName;2)
End if
$Loop:=$Loop+1
Until (($Loop>=3) | ($Done))
End if
If (Count parameters>=3)
$Delay:=$3
Else
$Delay:=0
End if
PROCESS PROPERTIES(Current process;$ProcessName;$ProcessState;$ProcessTime)
If ($NewProcessName#$ProcessName) ` This is not in its own Process
$ProcessID:=FND_DoProcess ($MethodName;$NewProcessName)
If (Application type#4D Server ) ` Don't use CALL PROCESS on the server
CALL PROCESS($ProcessID)
End if
$Go:=False
Else
$Go:=True
DELAY PROCESS(Current process;$Delay)
End if
Else
$Go:=False
End if
$0:=$Go