System Function DL: Difference between revisions

From NARS2000
Jump to navigationJump to search
(Created Quad DL - Delay Execution NARS wiki page)
 
No edit summary
Line 10: Line 10:
<p>The following pauses NARS APL program execution for roughly greater than six and a half seconds:</p>
<p>The following pauses NARS APL program execution for roughly greater than six and a half seconds:</p>


<apll>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⎕DL 6.651 <br>
<pre>
6.646<br>
      ⎕DL 6.651  
</apll>
6.646  
</pre>
 
R was 6.651 (user specified).  Z returned was 6.646.  This system function is useful where concurrent/simultaneous processes are running or APL may be dependent on an external routine/program which is running and that external routine needs to finish <u>first</u>, so for example APL can read in the external results.  If <apll>⎕DL</apll> is used in a user function, say within a loop, every R seconds your APL function can check for that external result, e.g. existence of a file, value within that file, etc.<br>
R was 6.651 (user specified).  Z returned was 6.646.  This system function is useful where concurrent/simultaneous processes are running or APL may be dependent on an external routine/program which is running and that external routine needs to finish <u>first</u>, so for example APL can read in the external results.  If <apll>⎕DL</apll> is used in a user function, say within a loop, every R seconds your APL function can check for that external result, e.g. existence of a file, value within that file, etc.<br>


{{System Variables}}
{{System Variables}}

Revision as of 05:14, 16 April 2018

⎕DL or system function Quad DL is available in monadic form only.

Monadic Function

Z←⎕DL R Delays APL program execution / pauses APL processing for the number of seconds specified in R. R should be a real number (representing seconds and it is not necessary for R to be a whole integer) and R should be greater than zero.
R is - normally a number greater than zero.
Z returned by APL's interpreter - is a scalar number, showing exactly how many actual seconds APL was delayed and Z's value is normally somewhat close to input R's value.

Monadic system function ⎕DL is similar to a sleep or thread sleep routine in other languages.

The following pauses NARS APL program execution for roughly greater than six and a half seconds:

      ⎕DL 6.651 
6.646 

R was 6.651 (user specified). Z returned was 6.646. This system function is useful where concurrent/simultaneous processes are running or APL may be dependent on an external routine/program which is running and that external routine needs to finish first, so for example APL can read in the external results. If ⎕DL is used in a user function, say within a loop, every R seconds your APL function can check for that external result, e.g. existence of a file, value within that file, etc.

System Variables (A value may be assigned to these except for ⎕DM)
ALX CT DM DT ELX FC FEATURE FPC IC IO
LR LX PP PR PW RL SA WSID
Niladic System Functions (a value cannot be assigned to these)
A AV EM ET LC NNAMES NNUMS SI SYSID SYSVER
T TC TCBEL TCBS TCESC TCFF TCHT TCLF TCNL TCNUL
TS WA
Monadic or dyadic system functions (a value cannot be assigned to these)
AT CR DC DFT DL DR EA EC ERROR ES
EX FMT FX MF NAPPEND NC NCREATE NERASE NINFO NL
NLOCK NREAD NRENAME NREPLACE NRESIZE NSIZE NTIE NUNTIE STOP TF
TRACE UCS VR
Note that quad functions and variables (except for the ⎕A family of functions) are case insensitive