POP_VALUE

Previous  Next

 

POP_VALUE( value )

 


 

Retrieves a parameter of type mb_value_t.  If not present, an error will be signalled.

 

The mb_value_t type is similar to the OLE data type VARIANT.  It contains a tag with the type, the name of the variable and the value of the variable.

 

This example is from the Graph Extension Library.

 

Example

 

/////////////////////////////////////////////////////////////////////////////

//

// nControl = GRAPH.Attach( pControl AS HANDLE,

//                          flags    AS INTEGER ) AS INTEGER

//

/////////////////////////////////////////////////////////////////////////////

//

int _NTGraph_Attach( mb_interpreter_t* s, void** l )

  {

  AFX_MANAGE_STATE( AfxGetStaticModuleState() );

  //////////////////////////////////////////////////////////////////////////

 

  BEGIN_PARSE( s, l )

     POP_VALUE( vControl )

     OPT_INT( dwFlags, TRUE )

  END_PARSE

 

  int nRet = 0;

 

  if ( vControl.type == MB_DT_STRING )

     {

     mb_value_t  vEnv;

 

     if ( mb_get_environment_var( s, vControl.value.string, &vEnv ) != MB_FUNC_OK )

        {

        RETURN_ERROR( SE_RN_INVALID_ARGUMENT );

        }

     endif

 

     nRet = g_this->Attach( vEnv.value.handle, dwFlags );

     }

  else if ( vControl.type == MB_DT_HANDLE )

     {

     nRet = g_this->Attach( vControl.value.handle, dwFlags );

     }

  else

     {

     RETURN_ERROR( SE_RN_INVALID_ARGUMENT );

     }

  endif

 

  RETURN_INT( nRet );

  }

endfunc