Index: trunk/Ohana/src/opihi/lib.shell/variable.c
===================================================================
--- trunk/Ohana/src/opihi/lib.shell/variable.c	(revision 8134)
+++ trunk/Ohana/src/opihi/lib.shell/variable.c	(revision 11084)
@@ -244,17 +244,18 @@
 }
 
-double get_double_variable (char *name) {
-  
-  int i;
-  char *local, *MacroName;
-
-  MacroName = GetMacroName ();
-
-  /* look for local variable first */
-  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
-  sprintf (local, "%s.%s", MacroName, name);
-  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
-    if (!strcmp(local, variables[i].name)) {
-      free (local);
+double get_double_variable (char *name, int *found) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      *found = TRUE;
       return (atof (variables[i].value));
     }
@@ -265,7 +266,39 @@
   for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
     if (!strcmp(name, variables[i].name)) {
+      *found = TRUE;
       return (atof (variables[i].value));
     }
   }
+  *found = FALSE;
+  return (0.0);
+}
+
+int get_int_variable (char *name, int *found) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      *found = TRUE;
+      free (local);
+      return (atof (variables[i].value));
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      *found = TRUE;
+      return (atof (variables[i].value));
+    }
+  }
+  *found = FALSE;
   return (0.0);
 }
