23rd August 2008 - There was an issue with our name caching server at around 08:00AM GMT. It has been fixed.

Script Commands

Scripting help and - or code

Script Commands

Postby TonyNo on Sun Mar 02, 2008 1:03 am

I think there is some cross-over here. What is the difference between the PH functions?

g_oGbl.EH_PH_MACRO
g_oGbl.EH_PH_CALL_RETVAR
g_oGbl.EH_PH_MACRO_RETVAR

In the designer Help, this is an example:

sRet = g_oGbl.EH_PH_MACRO("ph_macro(" & Chr(34) & "test1" & Chr(34) & ")")

but it is evaluating a formula not calling a macro.
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby JakeBullet on Sun Mar 02, 2008 5:40 pm

If you take a look at PH socket server - everything sent to it is a formula. And yeah this is crossover... :o
JakeBullet
Site Admin
 
Posts: 1101
Joined: Thu Mar 23, 2006 8:13 am

Postby TonyNo on Sun Mar 02, 2008 9:15 pm

So, these are all implemented the same way? One is not better/more appropriate than the other for one thing or another?

if not, I'll use the first one as it's shorter! :lol:
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby JakeBullet on Wed Mar 12, 2008 6:03 am

All the same way, through the PH socket server interface.
JakeBullet
Site Admin
 
Posts: 1101
Joined: Thu Mar 23, 2006 8:13 am

Postby TonyNo on Wed Mar 12, 2008 11:33 am

OK, just to be crystal-clear, I can use any of these three formats interchangeably?
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby JakeBullet on Wed Mar 12, 2008 1:17 pm

Yep - in the end it wont matter.
JakeBullet
Site Admin
 
Posts: 1101
Joined: Thu Mar 23, 2006 8:13 am

Postby TonyNo on Fri Mar 14, 2008 1:57 am

Next one: Will bad things happen if backslashes are in a PH formula?

This is giving me trouble...

Code: Select all
g_oGbl.EH_PH_MACRO("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) ")
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby TonyNo on Fri Mar 14, 2008 2:32 am

Other possible bad string delimiters are: \', ~", and ~~". :(
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby JakeBullet on Fri Mar 14, 2008 6:51 am

That should be fine. I treat it as a big string and just pass it to PH. Have you checked the error log to see what is getting passed to PH?
JakeBullet
Site Admin
 
Posts: 1101
Joined: Thu Mar 23, 2006 8:13 am

Postby jbbtex on Fri Mar 14, 2008 1:28 pm

Now, you know my VBS abilities are limited, but this
Code: Select all
g_oGbl.EH_PH_MACRO("ph_irchain(" & Chr(34) & "DVR_1" & Chr(34) & "," & Chr(34) & "0~t0~t3~t3" & Chr(34) & ")")

did not work for me. However this
Code: Select all
g_oGbl.EH_PH_CALL_RETVAR("ph_irchain(" & Chr(34) & "DVR_1" & Chr(34) & "," & Chr(34) & "0~t0~t3~t3" & Chr(34) & ")")


does work.
Brady
jbbtex
 
Posts: 67
Joined: Fri Nov 16, 2007 6:22 am
Location: Texas

Postby TonyNo on Fri Mar 14, 2008 2:34 pm

Yup. I found that, too.
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby TonyNo on Fri Mar 14, 2008 2:45 pm

Crap. It looks like the PHSS doesn't like the escaped quotes...
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA

Postby JakeBullet on Fri Mar 14, 2008 3:07 pm

escaped quotes? Don't you think you should capture them?
hehehehe sorry!!!!
JakeBullet
Site Admin
 
Posts: 1101
Joined: Thu Mar 23, 2006 8:13 am

Postby TonyNo on Fri Mar 14, 2008 5:20 pm

I have this figured out. They key was using "& chr$(34) &"...

Code: Select all
resp = ehCleanUpCRLF(g_oGbl.EH_PH_CALL_RETVAR("ph_rtne( ph_setvar_a( 1, 1, ph_winampinfo( " & Chr(34) & "listpos" & Chr(34) & ", 0, 0 ) ) + ph_setvar_a( 1, 2, 3 ) + ph_setvar_a( 1, 3, " & Chr(34) & Chr(34) & " )) + ph_rtne( ph_setvar_a( 1, 4, ph_getvar_n( 1, 1) - ph_getvar_n( 1, 2)) ) + ph_rtne( ph_forloopwinc(" & Chr(34) & "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>'))" & Chr(34) & ",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)"))
TonyNo
 
Posts: 350
Joined: Sat Mar 17, 2007 3:53 pm
Location: Illinois USA


Return to Screen Designer Scripting

Who is online

Users browsing this forum: No registered users and 1 guest



FREE FORUM Hosting by AtFreeForum. Create your Free WEB FORUM Hosting now!
GROUP DISCUSSION Features - Free FORUM HOSTING Directory Listing - DISCUSSION FORUM Terms of Service - FREE PHPBB Hosting Privacy
- FASHION ACCESSORIES
cron