Display_execution_context

Paweł Salawa edited this page Jan 15, 2018 · 1 revision

Definition

Language: Qt Script
Plugin for language: ScriptingQt
How to use: Create custom SQL function. Suggested name: displayContext
Function arguments undefined, user's choice
Function usage: SELECT displayContext('some argument', 5, 2.34)
Description: It inspects all local variables and displays them, together with their types. Example result of above usage would be:
                        typeof this = object
                        arguments[0] = some argument (string)
                        arguments[1] = 5 (number)
                        arguments[2] = 2.34 (number)                                                                                       |

Code

var n, arg, name;
var res = "";
res += "typeof this = " + typeof this + "\n";
for (name in this) {
    res += "this[" + name + "]=" + this[name] + "\n";
}
for (n = 0; n < arguments.length; ++n) {
    arg = arguments[n];
    res += "arguments[" + n + "] = " + arg + " (" + typeof arg + ")\n";
}
return res;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.