register()

Read(153) Label: dfx, register, function, call,

Description:

Register a dfx  file as a function to be called.

Syntax:

register(f,dfx)

Note:

The function registers a dfx file as function f to call it in a cellset script. The format is f(…). This is equivalent to call@r(dfx,…), in which … is a parameter in the dfx file. A function name can only be registered once.

Parameters:

f

Function name

dfx

dfx file path, which can be an absolute path or a relative path; a relative path is relative to the main directory

Return value:

  Result of executing the dfx file

Example:

  Below is emp.dfx:

 

A

 

1

=connect("demo")

 

2

=A1.query("select * from employee where DEPT=?",arg1)

 

3

return A2

 

 

 

A

 

1

=register("df1","D:/emp.dfx")

Register emp.dfx as df1 function

2

=df1("HR")

Call the registered function