Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Bug Reports
 PowerHome Messageboard : PowerHome Bug Reports
Subject Topic: ph_setglobal_a DOESN’T Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: February 08 2009 at 20:30 | IP Logged Quote GadgetGuy

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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: February 08 2009 at 20:49 | IP Logged Quote nadler

Put a parenthesis around the -1 and it will work.

ph_setglobal_a("globalname", (-1)) will work.

Noel
Back to Top View nadler's Profile Search for other posts by nadler
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 08 2009 at 21:10 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: February 08 2009 at 21:26 | IP Logged Quote GadgetGuy

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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: February 09 2009 at 07:20 | IP Logged Quote GadgetGuy

Thanks guys.

Before I saw your answers I got it to work using the
Code:
number("-10")
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 View GadgetGuy's Profile Search for other posts by GadgetGuy
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 09 2009 at 22:19 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum