Functions

<< Click to Display Table of Contents >>

Navigation:  Reference > Functions >

Functions

A CL function call consists of a reserved name preceded by a % sign and followed by an argument list in parentheses.

Invoking a CL function causes a value to be computed from one or more arguments specified. Functions are called in arithmetic expressions and table manipulation definitions; the value computed is placed in the appropriate variable or table cell(s).

Examples of variable definitions using functions:

dw $wtan=%atan($wval),

di $ilen=%clen($cname),

di $fixed=%round($float/4)+12

dw $wtop=(2.0*%max($i3,$w4*2,20.0))+%min($w5,10.0),

dw $wsum=%tsum(#1(r1-4,c0)),

dw $mhigh=%wmax($i1,$i2,$i3,$i4),

Examples of table manipulation using functions:

mt #1=%sqrt(#1),

mt #3(c1,r1-$)=%rnk(#4(c1,r1-$)),

mt #2(r1-$)=%tex(0.0,5.0,'Low'),

mt #6=%tneg(100.0,999999.9),

mt #34a1=%tval(0.000001,9999999.9,1.0),

mt #15a=%trun(#15b),

 

Following is a list of CL functions:

%ATAN

%CAL

%CLEN

%COS

CT

EXP

%EXP

%EXP10

%FRP

%INDEX

%JUL

%LOG

%LOG10

%MAX

%MIN

%RAND

%RIM

%RNK

%ROUND

%SIGD

%SIGE

%SIGI

%SIN

%SQRT

%STA

%STR

%TAVG

%TEX

%TMAX

%TMED

%TMIN

%TMODE

%TNEG

%TRUN

%TSTA

%TSUM

%TVAL

%WMAX

%WMIN