Lauching a new process

How to launch a new process in a single method:

This code initiates a new process to die when do something has been achieved

<code 4D>
C_TEXT($1)
If (Count parameters=0)
C_LONGINT($L_Process)
$L_Process:=New process(Current method name;0;Current method name;“Lancer”)
Else
READ ONLY(*)

  // Do something

End if
</code 4D>

This code initiates a new process to die when do something has been achieved AND the calling process has confirmed it received the expected answer:

<code 4D>
C_BOOLEAN($1)
If (Count parameters=0)

C_LONGINT($L_Process)
$L_Process:=New process(Current method name;0;Current method name;True) 

    C_REAL($A_Calculation)
C_BOOLEAN($B_Flag)
Repeat 
	DELAY PROCESS(Current process;2)
	IDLE
	GET PROCESS VARIABLE($L_Process;B_Flag;$B_Flag;A_Calculation;$A_Calculation)
Until ($B_Flag)
SET PROCESS VARIABLE($L_Process;B_Message_read;True)

Else

C_BOOLEAN(B_Flag;B_Message_read)
B_Flag:=False
B_Message_read:=False

READ ONLY(*)

 // Do something
    C_REAL(A_Calculation)
A_Calculation:=3+3

B_Flag:=True
Repeat 
	IDLE
	DELAY PROCESS(Current process;2)
Until (B_Message_read)

End if
</code 4D>