Warning: session_start(): open(/var/lib/php/sessions/sess_9ntvi17farnfgrrnbkl0gavdr4, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
set flag DynModule. // use central transpiler
cmodule StandardFunction {
switchable S functionName;
transient DynamicCallable f;
transient Throwable error;
start {
dm_registerAs('standardFunctionHolder);
onChange(r updateStatuses);
loadFunction();
}
visual
centerAndEastWithMargins(
withLabel("Function:", dm_label('functionName)),
jThreadedButton("Choose...", rEnter { dm_stringFieldDialog('functionName, onSet := rEnter newFunctionName) }));
void newFunctionName() {
setField(f := null);
setField(error := null);
loadFunction();
}
void updateStatuses {
setModuleName(
empty(functionName) ? "Standard function as module"
: "Function " + functionName + " - "
+ (hasError() ? "Error" : loaded() ? "loaded" : "not loaded"));
}
void loadFunction() q {
try {
setField(f := methodAsDynamicCallable(loadFunctions_cached(functionName), functionName));
} catch e {
setField(error := e);
}
}
// API
S functionName() { ret functionName; }
O callTheFunction(O... args) {
while (f == null && error == null) sleep(10);
if (error != null) throw rethrow(error);
ret callF(f, args);
}
bool loaded() { ret f != null; }
bool hasError() { ret error != null; }
}