Difference between revisions of "COMMAND()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Barrymavin (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
==SYNONYM== | ==SYNONYM== | ||
− | + | LIANJA_EXECUTE() | |
==SYNOPSIS== | ==SYNOPSIS== | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
− | int | + | int LIANJA_EXECUTE(command) |
<input parameters> | <input parameters> | ||
Line 19: | Line 19: | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
− | The | + | The LIANJA_EXECUTE() function will execute the specified command from within your 'C' function. This function returns 0 if successful, otherwise an error number. |
==EXAMPLE== | ==EXAMPLE== | ||
Line 34: | Line 34: | ||
<code lang="c"> | <code lang="c"> | ||
− | #include " | + | #include "lianja_api.h" |
lianjaapi_open() | lianjaapi_open() | ||
{ | { | ||
if (_parinfo(1) == APICTYPE) { | if (_parinfo(1) == APICTYPE) { | ||
− | _retni( | + | _retni(LIANJA_EXECUTE(_parc(1))); |
} else { | } else { | ||
_retni(-1); | _retni(-1); |
Latest revision as of 06:48, 11 April 2013
PURPOSE
Execute a command
SYNONYM
LIANJA_EXECUTE()
SYNOPSIS
#include "lianja_api.h" int LIANJA_EXECUTE(command) <input parameters> char *command; /* Address of a buffer containing a valid command */ <output parameters> none
DESCRIPTION
The LIANJA_EXECUTE() function will execute the specified command from within your 'C' function. This function returns 0 if successful, otherwise an error number.
EXAMPLE
The following example will open a table called accounts.
Example Lianja script:
m_result=open("use accounts") return
Example 'C' function:
#include "lianja_api.h" lianjaapi_open() { if (_parinfo(1) == APICTYPE) { _retni(LIANJA_EXECUTE(_parc(1))); } else { _retni(-1); } }