Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Creating timed formula 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: September 15 2010 at 13:48 | IP Logged Quote dhewison

Hi,

I am trying to create a timed event from a script that will run a script with parameter passing, however I cannot get past what I think is a nested quotes problem. Using the web interface\formula to run tests ph_createtimedevent( 2, "ph.runscript_3(x,"path", ..... needs nested quotes and it fails.

Is it possible ? Anyone know how to do it ?

The core problem I am trying to solve is to track what procedure or function is asking for a device to be on or off, i.e. :

time 00: function 1 switches device 1 on
time 01: function 2 switches device 1 on
time 02: function 1 no longer requires device 1 on
time 03: function 2 no longer requires device 1 on

at time 02 although function 1 no longer requires device 1 on, function 2 has not requested it to be switched off so it should stay on until all interestd functions have said it can switch off. My answer, at present, is to have an integer "demand" variable for each device, each bit allocated to a specific function. Each function then sets or clears its allocated bit and only when all bits are cleared does the device get switched off. This is fairly straight forward when done inside a script but I cannot figure out how to program future (timed) events.

Maybe I'm just heading towards a dead end, if anyone knows a better (or working) way I would be greatful to hear it.


David
Back to Top View dhewison's Profile Search for other posts by dhewison
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: September 15 2010 at 14:19 | IP Logged Quote grif091

Within PH you can use single and double quotes.

"xxxxx 'yyyyy' zzzzz"   or
'xxxxx "yyyyy" zzzzz'

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


Joined: February 28 2008
Location: United Kingdom
Online Status: Offline
Posts: 25
Posted: September 16 2010 at 03:46 | IP Logged Quote dhewison

Thanks Lee, I'll give that a try

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: September 16 2010 at 09:35 | IP Logged Quote dhewison

Hi Lee,

Thats sorted the problem thankyou.

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