Vladimir Ljaschko (10.09.2010 18:55, просмотров: 74) ответил vmp на Небольшой трюк
C препроцессором получилось так.
#define SETUP_DATA( num, type, name, engl, germ, defa, max, min ) if(se.##name > max) result=1; if(se.##name < min) result=1;
char SetupRangeError(void)
{ char result=0;
#include "OMT__setup.h"
return result;
}
#undef SETUP_DATA
OMT__setup.h:
SETUP_DATA ( 1, int, SetupVersion , "Setup version" , "" , 100 , 100 , 100 )
SETUP_DATA ( 2, char, TimeCollisionFactorUp , "Time factor UP" , "" , 100 , 255 , 0 )
SETUP_DATA ( 3, char, TimeCollisionFactorDown , "Time factor DOWN" , "" , 100 , 255 , 0 )
.......