Difference between revisions of "Python built-in Lianja/VFP functions"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Python built-in LianjaScript functions}} | {{DISPLAYTITLE:Python built-in LianjaScript functions}} | ||
Under construction | Under construction | ||
+ | ==Overview== | ||
+ | |||
+ | ==See Also== | ||
+ | [[Key-Value Store|Lianja/KVS (Key-Value Store)]] | ||
==Functions== | ==Functions== |
Revision as of 10:47, 5 March 2024
Under construction
Overview
See Also
Functions
The following LianjaScript functions are built into Lianja Python.
The function names are case-sensitive - in some cases more than one format is supported.
Function | Arguments | Description |
---|---|---|
createObject() | ||
die() | ||
echo() | ||
filetostr() | ||
getparameter() | ||
getParameter() | ||
kvs_add() | kvsid as numeric, key as string | key as numeric, value as objectname | value as arrayname | value as expression |
Add key/value for the specified key. If the value is an object or array it is automatically JSON encoded. To load the contents of a text file, you can use the filetostr() function which is built-in in Lianja/Python. kvs_add(k, key, filetostr("filename.txt") ) |
kvs_clear() | kvsid as numeric | Remove all key/value pairs from the store. |
kvs_close() | kvsid as numeric | Close the KVS. |
kvs_contains() | kvsid as numeric, key as string | key as numeric |
Returns true if key contained in the store. |
kvs_count() | kvsid as numeric | Returns count of number of key/value pairs in the store. |
kvs_create() | kvsfilename as string, keylen as numeric [, enablelogging as logical] |
Create a new KVS with keys of keylen length. Returns a numeric kvsid. |
kvs_generate() | kvsid as numeric, count as numeric |
Generate count new key/value pairs. |
kvs_get() | kvsid as numeric, key as string | key as numeric [, default as string [, membername as string]] |
Fetch value for the specified key. If the value is an object then membername specifies a member (property) to return. |
kvs_getall() | Fetch all keys/values for the specified key. keyPattern may end in * to match wildcard keys. Returns a dynarray of arrays. | |
kvs_getAll() | Fetch all keys/values for the specified key. keyPattern may end in * to match wildcard keys. Returns a dynarray of arrays. | |
kvs_getrange() | Fetch a range of key/value pairs (offset starts at 1). Returns an array of two elements, key and value. | |
kvs_getRange() | Fetch a range of key/value pairs (offset starts at 1). Returns an array of two elements, key and value. | |
kvs_info() | Displays information about the specified KVS file. | |
kvs_isvalid() | Check validity of the given ksvid. | |
kvs_keys() | Fetch all keys for the specified key. keyPattern may end in * to match wildcard keys. | |
kvs_list() | List the key/values in the store to the console (useful during development for debugging). | |
kvs_listlog() | List binary transaction log associated with the store to the console (useful during development for debugging). | |
kvs_listLog() | List binary transaction log associated with the store to the console (useful during development for debugging). | |
kvs_loadfromfile() | Load key/value pairs from the specified file. | |
kvs_loadFromFile() | Load key/value pairs from the specified file. | |
kvs_max() | Returns max key. | |
kvs_min() | Returns min key. | |
kvs_next() | Position on next key/value pair returns an array of two elements: key and value. | |
kvs_open() | Open an existing KVS. shared allows the KVS to be opened shared/exclusive. | |
kvs_rebuild() | Rebuild the KVS file from the binary transaction log. | |
kvs_remove() | Remove the specified key. | |
kvs_removefirst() | Use for queue. Returns an array of two elements: key and value. | |
kvs_removeFirst() | Use for queue. Returns an array of two elements: key and value. | |
kvs_removelast() | Use for stack. Returns an array of two elements: key and value. | |
kvs_removeLast() | Use for stack. Returns an array of two elements: key and value. | |
kvs_removerange() | Fetch a range of key/value pairs (offset starts at 1). | |
kvs_removeRange() | Fetch a range of key/value pairs (offset starts at 1). | |
kvs_rewind() | Position on first key/value pair. Returns an array of two elements: key and value. | |
kvs_savetofile() | Save key/value pairs to the specified file. | |
kvs_saveToFile() | Save key/value pairs to the specified file. | |
kvs_set() | Add/update key/value for the specified key. If the value is an object or array, it is automatically JSON encoded. | |
kvs_update() | Update value for the specified key. If the value is an object or array, it is automatically JSON encoded. | |
kvs_values() | Fetch all values for the specified key. keyPattern may end in * to match wildcard keys. | |
move_uploaded_file() | ||
odata_Create() | ||
odata_Delete() | ||
odata_Read() | ||
odata_Update() | ||
openDatabase() | ||
strtofile() | ||
unlink() |
Desktop Only Functions
The following LianjaScript functions are built into Lianja Python for desktop Apps only.
Function | Arguments | Description |
---|---|---|
bindEvent() | tbc | tbc. |
clear_events() | none | Stops event processing started with read_events(). |
debug() | text as string | Writes the specified text to the debug file (set debug on). |
debugout() | text as string | Writes the specified text to the Troubleshooter Debugout Tab. |
inputBox() | [prompt as string] | Display a box prompting for input. The prompt can optionally be specified; the default prompt is 'Enter value:' |
messageBox() | message as string [, options as numeric [, title as string]] |
Display a message in a box with an optional title. See MESSAGEBOX() for the numeric options to customize the buttons and icon and for the return values. |
read_events() | none | Suspends execution until a clear_events() is executed. |