Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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;

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /