Exemplo n.º 1
0
int	DLLEXPORT	TECOM_DB_Variables_SetIntegerValue( int handle , int vartype , char *name , int iIntegerValue , 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_SetIntegerValue ) has recieved NULL argument of variable name." );
	
	CHK_CMT( CmtGetTSVPtr ( handle , &pLocalStorage ));

	SetVarInt( pLocalStorage->pClb , vartype, name , iIntegerValue , hEquipmentHandle );
	
Error:
	
	if ( handle )
	{
		if ( IS_NOT_OK )
		{
			FREE_STDERR_POINTER(pLocalStorage->pLastError);
			GET_STDERR_CLEAR(pLocalStorage->pLastError);
		}
	
		CmtReleaseTSVPtr (handle);
	}
	
	return StdError.error;
}
Exemplo n.º 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;
	}
}