int	DLLEXPORT	TECOM_DB_Variables_SetStringValue( int handle , int vartype , char *name , char *pszStringValue , int hEquipmentHandle )
{
	STD_ERROR						StdError									=	{0};
	
	tsLocalStorage					*pLocalStorage								=	NULL;			
	
	IF (( handle == 0 )  , "The Module is not initialized yet. Please run ( TECOM_Init ) Function before that." );   
	IF (( name == NULL )  , "The function ( TECOM_DB_Variables_SetStringValue ) has recieved NULL argument of variable name." );
	IF (( pszStringValue == NULL )  , "The function ( TECOM_DB_Variables_SetStringValue ) has recieved NULL argument of variable value pointer." );
	
	CHK_CMT( CmtGetTSVPtr ( handle , &pLocalStorage ));

	SetVarString( pLocalStorage->pClb , vartype, name , pszStringValue , hEquipmentHandle );
	
Error:
	
	if ( handle )
	{
		if ( IS_NOT_OK )
		{
			FREE_STDERR_POINTER(pLocalStorage->pLastError);
			GET_STDERR_CLEAR(pLocalStorage->pLastError);
		}
	
		CmtReleaseTSVPtr (handle);
	}
	
	return StdError.error;
}
Example #2
0
// SetVar
//------------------------------------------------------------------------------
/*static*/ void BFFStackFrame::SetVar( const BFFVariable * var, BFFStackFrame * frame )
{
	frame = frame ? frame : s_StackHead;

	ASSERT( var );

	switch ( var->GetType() )
	{		
		case BFFVariable::VAR_ANY:				ASSERT( false ); break;
		case BFFVariable::VAR_STRING:			SetVarString( var->GetName(), var->GetString(), frame ); break;
		case BFFVariable::VAR_BOOL:				SetVarBool( var->GetName(), var->GetBool(), frame ); break;
		case BFFVariable::VAR_ARRAY_OF_STRINGS:	SetVarArrayOfStrings( var->GetName(), var->GetArrayOfStrings(), frame ); break;
		case BFFVariable::VAR_INT:				SetVarInt( var->GetName(), var->GetInt(), frame ); break;
		case BFFVariable::VAR_STRUCT:			SetVarStruct( var->GetName(), var->GetStructMembers(), frame ); break;
		case BFFVariable::VAR_ARRAY_OF_STRUCTS:	SetVarArrayOfStructs( var->GetName(), var->GetArrayOfStructs(), frame ); break;
		case BFFVariable::MAX_VAR_TYPES: ASSERT( false ); break;
	}
}