mb_push_real

Previous  Next

 

status_t mb_push_real( mb_interpreter_t* s, void** l, real_t val )

 


 

Pushes a function return value of type REAL to the interpreter.

 

Example

 

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

//

// Value = C3D_get_ad_chan( Fid           AS INTEGER,

//                          nFrameNo      AS INTEGER,

//                          nChanNo       AS INTEGER ) AS REAL

//

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

  {

  handle_t    nFid;

  int         nFrameNo;

  int         nChanNo;

  float       fVolt = 0;

 

  mb_check( mb_attempt_open_bracket( s, l ) );

  mb_check( mb_pop_handle( s, l, &nFid ) );

  mb_check( mb_pop_int( s, l, &nFrameNo ) );

  mb_check( mb_pop_int( s, l, &nChanNo ) );

  mb_check( mb_attempt_close_bracket( s, l ) );

 

  // Make sure the Fid is accessible

 

  if ( !AfxIsValidAddress( nFid, sizeof( tC3DFid ), FALSE ) )

     {

     mb_set_error( s, l, SE_RN_INVALID_FILE );

 

     return( MB_FUNC_ERR );

     }

  endif

 

  int err = C3D_get_ad_chan( (tC3DFid)nFid, nFrameNo, nChanNo, &fVolt );

 

  mb_check( mb_push_real( s, l, fVolt ) );

 

  return( MB_FUNC_OK );

  }

endfunc