Store Value Across Sessions
Rapise includes API simplifying reading and storing of values between sessions:
Global.GetProperty('Propname', defValue) -- Read property value from
%WORKDIR%\Config.json. See online help.
Global.SetProperty('PropName', value)-- Set property value to
%WORKDIR%\Config.json. If the file does not exist it will be created. See online help.
Here is a sample function. Every time it is called the value is incremented by 1 and new value is returned as a string
nnn is a new number.
// Read invoice number (or 100 if no previous number set yet)
var invoiceNo = Global.GetProperty('InvoiceNo', 100)
// Increment value by 1
// Store it for next use
// Make final string like 'INV-123'
You may put this function into Functions (
Calling from RVL
Once function is defined in the
.user.js it may be called from RVL using the
Functions object (all global functions are shown as methods for this object).
You may download and this sample test.