register()

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

Description:

Register a .dfx/.splx file as a function to be called.

Syntax:

register(f,spl)

Note:

The function registers a script file spl as function f to call it in a cellset script. Syntax of the function expression is f(xi,...), where xi,... is a parameter in the spl file. Use the comma to separate multiple parameters.

 

The function name is the one registered the last time.

Parameter:

f

Function name

spl

.dfx/splx 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 script 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.