| Author |  | 
      
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          
           | Posted: December 08 2007 at 17:37 | IP Logged |   |  
           | 
 |  I'm trying to set the value returned from an Input box to a global variable SLEEPINCNT - below is my best guess, but it doesn't work, I think because getsystemvar returns a string.
 
 ph_setglobal_n("SLEEPINCNT",ph_getsystemvar("[INPUTRET]"))
 
 suggestions?
 thanks!
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | BeachBum Super User
 
  
  
 Joined: April 11 2007
 Location: United States
 Online Status: Offline
 Posts: 1880
 | 
          I'm no expert, but will this get you closer..
           | Posted: December 09 2007 at 11:08 | IP Logged |   |  
           | 
 |  
 ph_setglobal_a("SLEEPINCNT",integer(ph_getsystemvar("INPUTRE T")))
 
 __________________
 Pete - X10 Oldie
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          You can also try this:
           | Posted: December 09 2007 at 11:51 | IP Logged |   |  
           | 
 |  
 ph_setglobal_s("SLEENINCNT","[INPUTRET]")
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          beachbum's answer is what I was looking for (missed the integer function in my search of the docs).
           | Posted: December 09 2007 at 11:52 | IP Logged |   |  
           | 
 |  
 Dave - I'm sure yours will work too, but I'm guessing only because PH is ok treating a 'string' that's only a number as a "number' later on...
 
 thanks guys
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          No problem.  Keep in mind that ALL variables are actually stored internally as a string (global, local, and temp) and are converted based upon context (in the case of variable substitution) or on-the-fly based upon the ph_get??? function (string, number, time, etc.)
           | Posted: December 09 2007 at 12:36 | IP Logged |   |  
           | 
 |  
 There are two "set" type of functions.  The default ph_setglobal_s to set a string and ph_setglobal_a to set ANY valid value.  Internally, the ph_setglobal_a will then convert the *any* value to type string and store it in the variable.  When it's time to recall the variable, it will be converted to the appropriate type based upon the ph_get??? function.
 
 HTH,
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          oh, ok - 8-}
           | Posted: December 09 2007 at 12:40 | IP Logged |   |  
           | 
 |  thanks
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  |