execute.compile

Description

Universal method for call more than one method API per request.

Define variable
a=1;

Create object:
b=new object;

Create array:
c=new array;

Set fields for array/object:
ob=new object;
set $ob -f a,b,c -v 1,2,3;
oa=new array;
set $oa -f 0,1,2 -v 0,1,2;

Remove field from array/object:
a=new object;
set $a -f 1,2,3 -v a,b,c;
rem $a -k 1;

Get argument from URL (pid=777):
pid=getArg pid;

Convert string to int:
e=int $e;

Return result:
ret $e;

Call API method:
d=call $(users.get) -userIds "vladislav805,1"

Get field of object/array:
d=call $(cities.get);
list=$d/items;

Example:
pid=getArg pid;
pid=int $pid;
sight=call $(sights.getById) -sightId $pid;
ownerId=$sight/ownerId;
owner=call $(users.get) -userIds $ownerId;
res=new object;
set $res -f s,u -v $sight,$owner;
ret $res

Arguments

string code (required)
Code

Example

code*