mb_has_arg_type |
bool_t mb_has_arg_type( mb_interpreter_t* s, void** l, mb_data_e type )
Detect if there is any more arguments and if so, the argument is of supplied type.
Example
///////////////////////////////////////////////////////////////////////////// // int _core_beep( mb_interpreter_t* s, void** l ) { /* BEEP statement */
int result = MB_FUNC_OK; int nBeep = -1;
mb_assert( s && l );
mb_check( mb_attempt_func_begin( s, l ) );
if ( mb_has_arg_type( s, l, MB_DT_INT ) ) mb_check( mb_pop_int( s, l, &nBeep ) );
mb_check( mb_attempt_func_end( s, l ) );
mb_check( mb_push_int( s, l, os_MessageBeep( nBeep ) ) );
return result; } endfunc
|