wapform_lazarus library
The WML tag engine: setvar, expression, condition, invoke,
the expand* text functions, DataSetRegistry and DbQuery.
Classes
- DataSetRegistry
- The datasets of one card, by id (case-insensitive).
- DbQuery
-
Runs SQL for a card (WML
<dbquery>): SELECTs become registered datasets.
Properties
- currentEvaluator → WapEvaluator?
-
no setter
- currentRegistry → DataSetRegistry?
-
no setter
-
varChangeHooks
→ List<
void Function(String name)> -
@@@ Notification fired when a variable is rewritten by setvar (lets the
UI sync the value back into an input field).
_varCtl only does one-way sync from "input field → variable". Without
this notify-back mechanism, when something like a WML
final
Functions
-
condition(
String str) → bool - condition — empty Str → false; returns bool on success, false on failure.
-
expandSql(
String s) → String -
Like expandText, for inserting whole SQL fragments (
$S); DbQuery.query uses it by default. -
expandSqlAuto(
String s) → String - Like expandSql, but string values are single-quoted and escaped; numbers are inserted as is.
-
expandSqlQuoted(
String s) → String - Like expandSql, but every value is single-quoted and escaped.
-
expandText(
String s) → String -
Expands
$name,$(expression)and$$ins, inserting values as is. -
expression(
String str, {bool nul = true}) → dynamic -
Expression — empty Str → null; returns the value on success, null on
failure (prints red-colored
ERRORtext). -
invoke(
String instance, String method, {dynamic params, String? result}) → dynamic - invoke — corresponds to WML's
-
setvar(
String name, dynamic value) → void - setvar — corresponds to WML's <setvar name= value=>.
-
useEngine(
WapEvaluator ev, [DataSetRegistry? registry]) → void -
Makes
ev(andregistry) the engine used by setvar, expression, condition, invoke and theexpand*functions.