Use of $ZF(-2) is deprecated

objectscriptQuality release 
3.1.0
Id 
OS0094
Rule type 
Code Smell
Severity 

Major

Major
SQALE characteristic 
  • Reliability
    • Exception handling
Tags 
deprecation, design
Remediation function 
Constant/issue
Remediation cost 
1h

The usage of $ZF(-2) is deprecated and should be used $ZF(-100) instead.

$ZF(-2) executes using the OS shell and it is asynchronous (it does not suspend execution of the current process). It immediately returns a status value upon spawning the child process. Because it does not await completion of the spawned child process it cannot receive status information from that process. $ZF(-2) sets $ZCHILD if its fifth argument is true.

$ZF(-100) permits an InterSystems IRIS process to invoke an executable program or a command of the host operating system. It executes the program or command specified in program as a spawned child process from the current console. $ZF(-100) allows you to invoke a program or command either synchronously or asynchronously, with or without invoking the operating system shell. $ZF(-100) sets $ZCHILD to the PID of the started program.