Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Stupid Question from Newbie Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
seekingdave
Newbie
Newbie
Avatar

Joined: October 29 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Posted: October 29 2007 at 08:40 | IP Logged Quote seekingdave

Hi all,

Sorry about the dumb question but I know it must be simple to work out when you know what you are doing .

I am trying to have a Macro start at a given time the next day, what I mean is I have set up a button for the morning routine macro in the control center and when pushed I need it to start at 7.30 for the next two days and not the time that I push the button, then next time I press the macro button, two days from that press etc.

Hope this makes some sense to you, looking forward to your help.

Cheers
Dave
Back to Top View seekingdave's Profile Search for other posts by seekingdave
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: October 29 2007 at 09:25 | IP Logged Quote jbbtex

Here's one way.

Create a global variable.

Have the CC button set the value of the global to 2.

Create a timed event to start your macro every day at the time you desire.

Have the first line of the macro check the value of the global.
Code:
JUMP IF("YOUR GLOBAL">0,1,999)

If the value is greater than zero, continue the macro, otherwise quit.

Have the last line in the macro set the global to 1 less. After the second day, the global will be zero and the macro will quit after the first line.
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
seekingdave
Newbie
Newbie
Avatar

Joined: October 29 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Posted: October 29 2007 at 10:46 | IP Logged Quote seekingdave

Hi and thanks for the reply,

Sorry to be a real Newbie but could you break this down into CHILD steps for me (PLEASE!!)

Sorry again for this

Cheers
Dave
Back to Top View seekingdave's Profile Search for other posts by seekingdave
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 29 2007 at 12:19 | IP Logged Quote dhoward

Dave,

Welcome to PowerHome!

This should be a fairly simple task with several ways of accomplishing. The way jbbtex outlines should work just fine but it may just be easier with a formula. The way I would do it is to set the Control Center button to execute the following button when pressed:

ph_createtimedevent(0,"YOUR MACRO ID",datetime(relativedate(today(),1),07:30:00)) + ph_createtimedevent(0,"YOUR MACRO ID",datetime(relativedate(today(),2),07:30:00))

That's it. What it does is create two "one-shot" timed events for the next day at 07:30 and the day after that at 07:30. Be sure and substitute the "YOUR MACRO ID" for the ID of the macro that you wish to run.

Hope this helps,

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

Joined: October 29 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Posted: October 29 2007 at 13:09 | IP Logged Quote seekingdave

Hi Dave

Thanks so much for the quick reply, and for the amazing software you have done a fantastic job (even a complete idiot like myself can work my way around this ) but it is great to have the forum here for the help, I am sure to ask a LOT of stupid questions so will say sorry now!!.

Another stupid question if you have time, is it possible to test a macro and cancel it half way through.

Thanks again

Dave
Back to Top View seekingdave's Profile Search for other posts by seekingdave
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: October 29 2007 at 14:06 | IP Logged Quote TonyNo

In the macro, just check the "skip" boxes on the lines that you don't want to execute during your testing. Just make sure to clear them when you are done.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
seekingdave
Newbie
Newbie
Avatar

Joined: October 29 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Posted: October 29 2007 at 14:55 | IP Logged Quote seekingdave

Thanks very much for all the help.

Cheers
Dave
Back to Top View seekingdave's Profile Search for other posts by seekingdave
 

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