Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Quote issues Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: October 28 2006 at 20:49 | IP Logged Quote smarty

I am trying to send a formula from Xlobby to PowerHome via phsscmd (PowerHome Socket Server).   Manny started me on this, and it works well.

My formula I want to send is:
ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917") This formula WORKS in PH (I tried it).

But, to send it from Xlobby, I need to write it inside of:
ph_formula(" ") <=and it should be in quotes.

Any idea how it should look?

ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ') doesn't work.

Any help is appreciated.



__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 28 2006 at 21:09 | IP Logged Quote Manny

Hey Smarty,
Have you tried using the tilde character? ~
I'm just guessing here and not sure it will work as the thread I'm quoting Dave from about quotes deals with web pages.

1. PowerScript will recognize strings surrounded by both single or double quotes. If you want to embed a single quote within a string, surround the string with double quotes. If you want to embed a double quote within a string, surround the string with single quotes.

2. In PowerScript, you can also prefix a single or double quote with one or more ~ (tilde) characters to embed quotes. For example...if you wanted to surround a string with single quotes and embed a single quote, you could do it like this: 'This is an embedded single quote ~' in the middle of this string'.
       


Here's the .
thread

Edited by Manny - October 28 2006 at 21:10
Back to Top View Manny's Profile Search for other posts by Manny
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 28 2006 at 21:15 | IP Logged Quote dhoward

Smarty,

Manny has you covered. However, the part I don't understand is why you need to pass the ph_wcopen function within a ph_formula function. PHSSCMD should be able to send the ph_wcopen function directly.

Anyways, what you posted should work. Either

ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ')

or

ph_formula( "ph_wcopen(1, 'http://www.pandora.com/?sc=sh158735660495974917' ")

should be valid statements in regards to single and double quotes.

Give me a little more details and I'll see if I can pinpoint what's going on for you.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: October 28 2006 at 22:03 | IP Logged Quote Manny

Yep.
phsscmd.exe ph_wcopen(1,"http://www.pandora.com/?sc=sh158735660495974917 ")

opened the Pandora site within PowerHome's internal web browser when I ran it from XLobby.


PS
I'm a Pandora fan too.

Back to Top View Manny's Profile Search for other posts by Manny
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: October 29 2006 at 08:54 | IP Logged Quote smarty

Thanks Manny and Dave .





__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: March 14 2008 at 11:00 | IP Logged Quote TonyNo

In the vein of this thread, I'm having trouble finding quotes that work beyond two deep for use in eHome.

I've tried tildes and backslashes, but it seems only ' and " work.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: March 14 2008 at 13:38 | IP Logged Quote TonyNo

Still wondering about the quotes, but found using "& chr$(34) &" worked in a VBS.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: March 20 2008 at 23:25 | IP Logged Quote dhoward

Tony,

Do you have a sample of what you're trying to send (and how you're trying to send it because it sometimes makes a difference)?

Usually, you just need to use one or more tilde characters for embedded double and single quotes. If it's real tricky, you should also be able to use the PH equivalent of chr$ like this: " + char(34) + "

Let me know,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: March 21 2008 at 07:30 | IP Logged Quote TonyNo

Hey Dave!

What I started with was this...

Code:
ph_rtne( ph_setvar_a( 1, 1, ph_winampinfo( "listpos", 0, 0 ) ) + ph_setvar_a( 1, 2, 3 ) + ph_setvar_a( 1, 3, "" )) + ph_rtne( ph_setvar_a( 1, 4, ph_getvar_n( 1, 1) - ph_getvar_n( 1, 2)) ) + ph_rtne( ph_forloopwinc("ph_concatvar( 1, 3, if( ph_winampinfo( 'listtitlename', ph_getvar_n( 1, 4 ), 0)='', '', ph_getvar_n( 1, 4 ) + ': ' + if( ph_getvar_n( 1, 4) = ph_getvar_n( 1, 1), '> ', '' ) + ph_winampinfo( 'listtitlename', ph_getvar_n( 1, 4 ), 0) + '<br>'))",ph_getvar_n( 1, 1) - ph_getvar_n( 1, 2),ph_getvar_n( 1, 1) + ph_getvar_n( 1, 2), 1, 4)) + ph_getvar_s( 1, 3)

It is wrapped in double quotes, so I needed to switch out the ones used here.

I also did some testing with phsscmd using this and was not able to find escaped quotes that worked. These were the only ones that did.

Code:
"D:\Program Files\PHSSCMD\phsscmd.exe" ph_macro("PLAY PAUSE")
"D:\Program Files\PHSSCMD\phsscmd.exe" ph_macro('PLAY PAUSE')


Edited by TonyNo - March 26 2008 at 07:21
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: March 30 2008 at 10:53 | IP Logged Quote grif091

I'm new to PowerHome so this observation may not mean anything but the "doesn't work" statement in the first post is not balanced.

ph_formula( 'ph_wcopen(1, "http://www.pandora.com/?sc=sh158735660495974917" ') doesn't work

There are two open parens "(" but only one closed paren ")". Maybe a typo when entered in the forum? Most syntax scanners won't like unbalanced statements.   

__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 

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