Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3886

JavascriptEngineMBS - Function without parameters

$
0
0

When my script calls a function without parameters, the function returns the following value: function (){ [native code]}

Example 1: (Doesn’t work)

CJSEngine.RegisterFunction ("GetNumber", AddressOf JS_GetNumber ,0, nil)

Script:

Value = 0;
Value = GetNumber;

Example 2: (Doesn’t work)

CJSEngine.RegisterFunction ("GetNumber", AddressOf JS_GetNumber ,1, nil)

Script:

Value = 0;
Value = GetNumber;

Example 2: (works)

CJSEngine.RegisterFunction ("GetNumber", AddressOf JS_GetNumber ,1, nil)

Script:

Value = 0;
Value = GetNumber("AnUnusedParameter");

In this case I’ve added to GetNumber and JS_GetNumber functions a parameter to pass.

Am I performing a wrong manipulation or is this correct?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3886

Trending Articles