Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: getglobal statement I can’t make work Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jostim
Groupie
Groupie
Avatar

Joined: February 12 2007
Location: United States
Online Status: Offline
Posts: 45
Posted: August 19 2007 at 11:57 | IP Logged Quote jostim

I have a program I can't get to work. It boils down to the following formula. I added the "ph_rtne (ph_setvar_a (1,1,8)) +" to make it work inside this one formula:

ph_rtne (ph_setvar_a (1,1,8)) +
ph_getglobal_s (
"AV CHANNEL " + string ([LOCAL1],"00")
)
RESULT (from Verify): !

I then make the following change (comment out lines 2 and 4).

ph_rtne (ph_setvar_a (1,1,8)) +
/*ph_getglobal_s (*/
"AV CHANNEL " + string ([LOCAL1],"00")
/*)*/
RESULT (from Verify):!

Next I ad quotes to [LOCAL1], now I get a result, but I expect the result “AV CHANNEL 08” and I get “AV CHANNEL 00”

ph_rtne (ph_setvar_a (1,1,8)) +
/*ph_getglobal_s (*/
"AV CHANNEL " + string ("[LOCAL1]","00")
/*)*/
RESULT (from Verify): AV CHANNEL 00

Now I remove the quotes again and get the result I feel I should get:

ph_rtne (ph_setvar_a (1,1,8)) +
/*ph_getglobal_s (*/
"AV CHANNEL " + string ([LOCAL1],"00")
/*)*/
RESULT (from Verify):: AV CHANNEL 08

Now I remove the comments from lines 2 and 4

ph_rtne (ph_setvar_a (1,1,8)) +
ph_getglobal_s (
"AV CHANNEL " + string ([LOCAL1],"00")
)
RESULT (from Verify): content of [LOCAL1]

YES! It works!
Now I close the formula and open it again, and I am back to square one: RESULT: !.
What am I missing here? Any ideas anyone?   

__________________
- jos
Back to Top View jostim's Profile Search for other posts by jostim
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: August 19 2007 at 12:37 | IP Logged Quote TonyNo

You have a bunch of Globals called "AV CHANNEL xx" and are trying to get their contents?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
jostim
Groupie
Groupie
Avatar

Joined: February 12 2007
Location: United States
Online Status: Offline
Posts: 45
Posted: August 19 2007 at 17:44 | IP Logged Quote jostim

Exactly.
They are the names and web addresses of radio stations I listen to using Winamp.
I should have explained that better.

- jos



__________________
- jos
Back to Top View jostim's Profile Search for other posts by jostim
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: August 19 2007 at 17:54 | IP Logged Quote TonyNo

Try this

Code:
ph_rtne(ph_setvar_a(1, 1, 8)) + ph_getglobal_s( "AV CHANNEL " + string( ph_getvar_n( 1, 1), "00"))
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
jostim
Groupie
Groupie
Avatar

Joined: February 12 2007
Location: United States
Online Status: Offline
Posts: 45
Posted: August 19 2007 at 22:52 | IP Logged Quote jostim

That did the job.

Thanks!

- jos



__________________
- jos
Back to Top View jostim's Profile Search for other posts by jostim
 

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