Index: /orxonox/trunk/src/util/loading/load_param.cc
===================================================================
--- /orxonox/trunk/src/util/loading/load_param.cc	(revision 4623)
+++ /orxonox/trunk/src/util/loading/load_param.cc	(revision 4624)
@@ -113,4 +113,36 @@
 }
 
+
+int isInt(const char* Int, int defaultValue)
+{
+  char* endPtr = NULL;
+  int result = strtol(Int, &endPtr, 10);
+
+  if ( endPtr >= Int && endPtr < Int + strlen(Int))
+    return defaultValue;
+  else
+    return result;
+}
+
+float isFloat(const char* Float, float defaultValue)
+{
+  char* endPtr = NULL;
+  double result = strtod(Float, &endPtr);
+
+  if ( endPtr >= Float && endPtr < Float + strlen(Float))
+    return defaultValue;
+  else
+    return result;
+}
+
+const char* isString(const char* string, const char* defaultValue)
+{
+  if (string != NULL)
+    return string;
+  else
+    return defaultValue;
+}
+
+
 /**
    \param descriptionText The text to set as a description for this Parameter
Index: /orxonox/trunk/src/util/loading/load_param.h
===================================================================
--- /orxonox/trunk/src/util/loading/load_param.h	(revision 4623)
+++ /orxonox/trunk/src/util/loading/load_param.h	(revision 4624)
@@ -51,10 +51,10 @@
 
 #define l_INT_TYPE         int                  //!< The type of an INT
-#define l_INT_FUNC         atoi                 //!< The function to call to parse INT
+#define l_INT_FUNC         isInt                //!< The function to call to parse INT
 #define l_INT_NAME         "int"                //!< The name of an INT
 #define l_INT_DEFAULT      0                    //!< a default Value for an INT
 
 #define l_LONG_TYPE        long                 //!< The type of a LONG
-#define l_LONG_FUNC        atol                 //!< The function to parse a LONG
+#define l_LONG_FUNC        isInt                //!< The function to parse a LONG
 #define l_LONG_NAME        "long"               //!< The name of a LONG
 #define l_LONG_DEFAULT     0                    //!< a default Value for a LONG
@@ -66,10 +66,10 @@
 
 #define l_FLOAT_TYPE       float                //!< The type of a FLOAT
-#define l_FLOAT_FUNC       atof                 //!< The function to parse a FLOAT
+#define l_FLOAT_FUNC       isFloat              //!< The function to parse a FLOAT
 #define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
 #define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
 
 #define l_STRING_TYPE      const char*          //!< The type of a STRING
-#define l_STRING_FUNC                           //!< The function to parse a STRING
+#define l_STRING_FUNC      isString             //!< The function to parse a STRING
 #define l_STRING_NAME      "string"             //!< The name of a STRING
 #define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
@@ -95,5 +95,5 @@
     { \
       if (loadString != NULL && root != NULL) \
-        (*pt2Object.*function)(type1##_FUNC(loadString)); \
+        (*pt2Object.*function)(type1##_FUNC(loadString, default1)); \
       else \
         PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
@@ -116,5 +116,5 @@
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 2) \
-            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1))); \
+            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0), default1), type2##_FUNC(subLoads.getString(1), default2)); \
           else \
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
@@ -142,5 +142,5 @@
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 3) \
-            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2))); \
+            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0), default1), type2##_FUNC(subLoads.getString(1), default2), type3##_FUNC(subLoads.getString(2), default3)); \
           else \
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
@@ -171,5 +171,5 @@
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 4) \
-            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2)), type4##_FUNC(subLoads.getString(3))); \
+            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0), default1), type2##_FUNC(subLoads.getString(1), default2), type3##_FUNC(subLoads.getString(2), default3), type4##_FUNC(subLoads.getString(3), default4)); \
           else \
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
@@ -202,5 +202,5 @@
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 5) \
-            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0)), type2##_FUNC(subLoads.getString(1)), type3##_FUNC(subLoads.getString(2)), type4##_FUNC(subLoads.getString(3)), type5##_FUNC(subLoads.getString(4))); \
+            (*pt2Object.*function)(type1##_FUNC(subLoads.getString(0), default1), type2##_FUNC(subLoads.getString(1), default2), type3##_FUNC(subLoads.getString(2), default3), type4##_FUNC(subLoads.getString(3), default4), type5##_FUNC(subLoads.getString(4), default5)); \
           else \
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
@@ -226,4 +226,17 @@
 }
 
+
+/***********************
+*** HELPER FUNCTIONS ***
+***********************/
+int           isInt(const char* Int, int defaultValue);
+float         isFloat(const char* Float, float defaultValue);
+const char*   isString(const char* string, const char* defaultValue);
+//TiXmlEmlemnt* isXmlElem(const)
+
+
+/************************
+*** DESCRIPTION STUFF ***
+************************/
 //! A class that handles the description of loadable parameters
 class LoadParamDescription
@@ -269,4 +282,8 @@
 };
 
+
+/**************************
+**** REAL DECLARATIONS ****
+**************************/
 //! abstract Base class for a Loadable parameter
 class BaseLoadParam : public BaseObject
