11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

HANGNote:You cannot express hangtime as a decimal value on PowerPC/AIX 4.1 andRS/6000/AIX 4.1 based systems. On these systems, express hangtime in integerwhole seconds.You can specify hangtime as a comma-separated list of numeric expressions. The resultinghang is the sum of these expressions. Negative numbers are treated as zero. Therefore, ahangtime of 16,-15 would hang for 16 seconds.ExamplesThe following example suspends the process for 10 seconds:WRITE !,$ZTIME($PIECE($HOROLOG,",",2))HANG 10WRITE !,$ZTIME($PIECE($HOROLOG,",",2))The following example suspends the process for 1/2 second. $ZTIMESTAMP, unlike$HOROLOG, can return fractional seconds if the precision parameter of the $ZTIMEfunction is specified.WRITE !,$ZTIME($PIECE($ZTIMESTAMP,",",2),1,2)HANG .5WRITE !,$ZTIME($PIECE($ZTIMESTAMP,",",2),1,2)Returns values such as the following:14:34:19.7514:34:20.25NotesHow HANG Time is CalculatedThe HANG time is calculated using the system clock. If the clock is midway between secondswhen a HANG with 1 second or less is executed, the actual elapsed HANG time is only theremaining portion of the current clocktime second.HANG Compared with Timed READYou can use HANG to pause the routine while the user reads an output message. However,you can handle this type of pause more effectively with a timed READ command. A timedREAD allows the user to continue when ready, but a HANG does not because it is set to afixed duration.See Also• READ command<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!