Difference between revisions of "Server Side Procedures - Parameter Passing Examples"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Overview== For an overview of server side procedures, see here. ==Lianja/VFP Server Side Procedures== ===exports.c...")
 
(Overview)
Line 1: Line 1:
 
==Overview==
 
==Overview==
For an overview of server side procedures, see [[:Category:Lianja_Cloud_Server#Server_side_procedures|here]].
+
For an overview of using server side procedures with the Lianja Web Client and Lianja Cloud Server, see [[:Category:Lianja_Cloud_Server#Server_side_procedures|here]].
  
 
==Lianja/VFP Server Side Procedures==
 
==Lianja/VFP Server Side Procedures==

Revision as of 11:06, 11 February 2020

Overview

For an overview of using server side procedures with the Lianja Web Client and Lianja Cloud Server, see here.

Lianja/VFP Server Side Procedures

exports.conf

A function can be called directly if it is declared in exports.conf.

var result = mylibproc();
Exports.conf


Lianja.evaluate()

The Lianja.evaluate() method can be used to call a Lianja/VFP function/procedure.

var result = Lianja.evaluate("myproc()");

To call a procedure in a library, prefix the procedure name with the library name and '::'.

var result = Lianja.evaluate("mylib::mylibproc()");
Lianja.evaluate()


Note how to build up the string passed to Lianja.evaluate() when using local variables:

Numeric variables:

var num5 = 5;
var num6 = 7;
var result = Lianja.evaluate("mylib::mylibproc(" + num5 + "," + num6 + ")");

String variables (include quotes):

var num7 = "5";
var num8 = "7";
var result = Lianja.evaluate("mylib::mylibproc('" + num7 + "','" + num8 + "')");

Macro substitution with {} can be used on globals:

Numeric:

num1 = 5;
num2 = 7;
var result = Lianja.evaluate("mylib::mylibproc({num1},{num2})");

Strings (include quotes):

num3 = "5";
num4 = "7";
var result = Lianja.evaluate("mylib::mylibproc('{num3}','{num4}')");