MAKE_STRING |
MAKE_STRING( pString, length )
Create a new string suitable to be used as a return string using RETURN_STRING. The string is initialized to empty.
Example
int _getfilename( mb_interpreter_t* s, void** l ) { // FILE.GetName( int nIndex, LPCTSTR strOptions )
BEGIN_PARSE( s, l ) POP_INT( nIndex ) OPT_STRING( pOptions, NULL ) END_PARSE
// Need to allocate from MB malloc since string variables are deallocated in MyBASIC2.c
MAKE_STRING( pFileName, _MAX_PATH );
CHECK_STATUS( g_this->GetFileName( nIndex, pOptions, pFileName ) );
RETURN_STRING( pFileName ); } endfunc
|