| Author | 
         | 
         
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: February 08 2009 at 20:30 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
After a frustrating hour of debugging error alerts in the Event Log I'm beginninng to believe this is a bug.
 
 A statement of ph_setglobal_a("globalname", 1) works but ph_setglobal_a("globalname", -1) does not!
 
 Is there some reason that negative numbers cannot be used in Globals?    
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         nadler Super User 
          
 
  Joined: February 25 2006 Location: United States
 Online Status: Offline Posts: 354
          | 
        
         
          
           | Posted: February 08 2009 at 20:49 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Put a parenthesis around the -1 and it will work.
 
 ph_setglobal_a("globalname", (-1))  will work.
 
 Noel
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         dhoward Admin Group 
          
  
  Joined: June 29 2001 Location: United States
 Online Status: Offline Posts: 4447
          | 
        
         
          
           | Posted: February 08 2009 at 21:10 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Always make sure to have a "space" in front and behind the "-" character.  Its a problem with the PowerBuilder language that PowerHome is written in.  That should fix it as well.
 
 Dave.
 
         | 
       
       
        | Back to Top | 
         
          
          
         | 
       
       
       
        |   | 
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: February 08 2009 at 21:26 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Actually it is a LOCAL that is the data element.  In debugging I used a fixed integer number to discover the cause of the problem, thus I cannot really insert (easily) a space behind the "-" sign.
 
 So should I thus use. . .
 
 ph_setglobal_a("globalname",([LOCAL1]))
 
 as the formula?
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: February 09 2009 at 07:20 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Thanks guys.
 
 Before I saw your answers I got it to work using the  approach, which also did the trick.
  Edited by GadgetGuy - February 09 2009 at 07:36
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         dhoward Admin Group 
          
  
  Joined: June 29 2001 Location: United States
 Online Status: Offline Posts: 4447
          | 
        
         
          
           | Posted: February 09 2009 at 22:19 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I gotcha.  As usual, several ways to do it.
 
 Using the ph_getvar function such as
 
 ph_setglobal_a("GLOBALID",ph_getvar_n(1,1))
 
 should do the trick.  Or as Noel suggested, surrounding the [LOCAL1] with open and close parens will do the trick (I never even thought of this one  ).
 
 Or as you've discovered:
 
 ph_setglobal_a("GLOBALID",number("[LOCAL1]"))
 
 should also get the job done.
 
 Dave.
 
         | 
       
       
        | Back to Top | 
         
          
          
         | 
       
       
       
        |   |