Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Problem running scripts in 2.1b Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dhewison
Newbie
Newbie


Joined: February 28 2008
Location: United Kingdom
Online Status: Offline
Posts: 25
Posted: December 23 2008 at 11:21 | IP Logged Quote dhewison

Hi,

I have just tried upgrading from 1.03.4.12 to 2.1b and not of my scripts appear to run.

Platform: Windows 2000 server + SP4

I tend control everything using jscript which I run from simple macros (just a ph_runscript_0 to launch them). To upgrade I followed the upgrade instructions, renamed folder, installed 2.1b, copied db, scripts and ini then ran phupg.exe. The upgrader failed with an error at first reporting gdiplus.dll missing, I downloaded Microsoft's GDI+ SDK redistributable and copied the dll into the system32 folder. The upgrader then ran ok.

When a script runs it is reported as having run in the eventlog but nothing happens, I've tried a trace by writing to global variables but the write does not appear to happen. Switching back to version 1.03.4.12 and the scripts run fine.

Also the port nuber for the web server seems to held as a signed integer and can only be set to the lower half of the port range (32767).

Is there something else I need to do to get scripts running with 2.1b ?

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

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 23 2008 at 15:26 | IP Logged Quote dhoward

David,

Your problem is likely due to a change in the ph_runscript_? functions that occurred in version 2.0.0 of PowerHome. If you were to look at the function definitions in the 2.1b version of the Help file, you'll see that the ph_runscript_? functions have been greatly simplified. For example, the ph_runscript_0 function now only requires 3 parameters, the first being the timeout value, the second being the full path and filename of the script file, and the third being the function or subroutine you wish to run.

Along with the function changes, the script support was enhanced to allow for #include files. All scripts default to vbscript so you'll want to include an "@language=jscript" in your script file. A sample jscript file may look like this:

Code:

@language=jscript

#include=c:\program files\powerhome\common.js

function f_main()
{
...some code
}


To help you locate all the places you'll need to change the ph_runscript_? functions, go to the PowerHome menu Reports|Database Where Used. For a search string use:

%ph_runscript_%

This should search the database and give you a report wherever you've used a ph_runscript_? function.

Also, take a look at the new ph_evalscript and ph_executescript functions to see if they are helpful to you or not since these are also WSH related.

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
dhewison
Newbie
Newbie


Joined: February 28 2008
Location: United Kingdom
Online Status: Offline
Posts: 25
Posted: December 24 2008 at 12:30 | IP Logged Quote dhewison

Dave,

Thanks for the prompt response, I'll take a look at it next week after the Christmas festivities are over. As I made no changes to the macros or scripts you are very likely spot on.

Can you fix the web port number when you do another release, as you can guess in 1.03.4.12 I used a port number above 32767 ?

Merry Christmas,
David
Back to Top View dhewison's Profile Search for other posts by dhewison
 
dhewison
Newbie
Newbie


Joined: February 28 2008
Location: United Kingdom
Online Status: Offline
Posts: 25
Posted: April 16 2009 at 14:44 | IP Logged Quote dhewison

Hi Dave,

I have finally got around to trying powerhome 2 again and I cannot get the scripts to run. Adding "@language=jscript " at the start of the script just generates a vbscript syntax error.

@language=jscript

function main()
{
...some code
}

just creates a vbscript error. Does anyone out there use jscript ?

Also the help files shows different syntax for ph_runscript and ph.runscript, is this correct ?

- David
Back to Top View dhewison's Profile Search for other posts by dhewison
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 16 2009 at 15:20 | IP Logged Quote dhoward

David,

I either made a mistake in my sample code or the forum software stripped some characters but the "jscript" needs to be surrounded by double quotes like so:

@language="jscript"

This should fix the error and properly switch the code to jscript.

I just looked into the ph_runscript and ph.runscript code and you are correct. They ARE different and this is an error (as such, they won't work no matter what format you use). The ph.runscript needs to match the ph_runscript signature and I'll need to correct this in the upcoming beta.

Thanks for catching this bug for me.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
dhewison
Newbie
Newbie


Joined: February 28 2008
Location: United Kingdom
Online Status: Offline
Posts: 25
Posted: April 17 2009 at 12:15 | IP Logged Quote dhewison

Dave,

That sorted it thank you, I'm grateful for your help.

- David
Back to Top View dhewison's Profile Search for other posts by dhewison
 

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