64,651
社区成员
发帖
与我相关
我的任务
分享
object scriptdemo {
/*
*
*/
native {
void XF__ObjectConstruct()
{
_value = 123;
}
int _value;
}
/*
*
*/
property get value() {
//INT32_TO_NPVARIANT( _value , __result );
XNPVariant var( "asdfefsdf" );
var.detachVariant( __result );
}
/*
* root.subobject
*/
property get subobject() = object {
/*
*
*/
native {
void XF__ObjectConstruct()
{
_value = 321;
}
int _value;
}
/*
*
*/
property get value() {
INT32_TO_NPVARIANT( _value , __result );
}
property put value( val ) {
if( NPVARIANT_IS_INT32( val ) )
_value = NPVARIANT_TO_INT32( val );
else if( NPVARIANT_IS_DOUBLE( val ) )
_value = (int)NPVARIANT_TO_DOUBLE( val );
else if( NPVARIANT_IS_BOOLEAN( val ) )
_value = (int)NPVARIANT_TO_BOOLEAN( val );
else
return false;
}
method foobar( a , b , c ) {
printf( "method foobar( a , b , c )\n" );
INT32_TO_NPVARIANT( 123321 , __result );
}
//
// function == method
//
function foobar( a , b ) {
printf( "method foobar( a , b )\n" );
INT32_TO_NPVARIANT( 321123 , __result );
}
//
// function == method
//
function foobar( ... ) {
printf( "method foobar( ... ) __argc : %d\n" , __argc );
INT32_TO_NPVARIANT( 123123 , __result );
}
}
property get config() = object {
property get url() {
}
property put url( val ) {
}
function set_timeout( val ) {
}
}
}