A type string may contain a "/"
to indicate that any remaining parameters are optional. For example, suppose that a method foo
’s type string is "ss/ib"
. The method could be implemented in C using a function such as:
void foo(PODSObject* self, PODSString s, PODSString t, PODSInt32 I, PODSBoolean b) |
Note that the C function has no special knowledge of the fact that its last two arguments are optional when called from JavaScript. If JavaScript calls
p.foo("hello", "world") |
then M-Business automatically passes the values 0 and PODS_FALSE
as the method’s third and fourth arguments. Similarly, JavaScript can call
p.foo("hello", "world", 234) |
and M-Business supplies the default value PODS_FALSE
for the fourth argument only. If JavaScript calls
p.foo("hello") |
then a JavaScript error results, because the call has not supplied all required arguments.
Send feedback about this page using email. | Copyright © 2008, iAnywhere Solutions, Inc. |