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

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 12:24 | IP Logged Quote GadgetGuy

I'm having trouble getting a reliable reading from my
Insteon Thermostat and am attempting to retry "bad"
readings, but can't figure out how to JUMP properly.

It appears there are two ways to "Jump" by either using
the "JUMP" command in the macros Command Field (but then
how does one specify the jump value?). The doco is
quite confusing.

I've also seen a "JUMP" function as part of an actual
macro command in a forum example, but couldn't determine
how it works and there is no mention in any doco I can
find....

BTW is there any better documentation anywhere yet? I
keep looking but can only find a 2006 User Manual which
is pretty much out of date.

Can anyone give me a example of an actual JUMP bit of
coding to get me going?

As always---Thanks

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 08 2009 at 13:22 | IP Logged Quote TonyNo

JUMP just needs the number of lines to jump.

Example:
10 Comment Start Here
20 Jump 2
30 Comment This will be jumped over
40 Comment Here is where the jump will land
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: January 08 2009 at 14:29 | IP Logged Quote onhiatus

I'd strongly recommend using the "GOTO" command instead - that way when you insert steps you don't have to change all of your Jumps

From the other Tony's example:
10 Comment Start Here
20 Goto "Continue"
30 Comment This will be jumped over
40 Label Continue
50 Comment Here is where the goto will land

Only thing to be careful about is that the goto command expects a string so you need quotes around the label name, while the label definition does not need quotes.

Have fun, Tony
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 20:51 | IP Logged Quote GadgetGuy

Thanks guys -

But I'm still at a loss. Both of the above solutions
appear to be static jumps. I need a computed jump.

I want to Jump on conditional results. Thus I was
looking for something like
    JUMP(a>2,1,5)
where if true it would jump 1 (to the next line), or
down 5 lines on FALSE.

Is there such an animal?

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 21:28 | IP Logged Quote GadgetGuy

To be specific... I tried something like this but it
doesn't work. Is there an equivalent that does work?

if({FLAG}=1,Goto "DOIT",Goto "RETRY")



__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 08 2009 at 21:58 | IP Logged Quote TonyNo

You need to do it this way...

20 GOTO if( {FLAG}=1, "DOIT", "RETRY")
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 22:12 | IP Logged Quote GadgetGuy

Ah ha!

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 08 2009 at 22:21 | IP Logged Quote GadgetGuy

TonyNo wrote:
You need to do it this way...
20 GOTO if( {FLAG}=1, "DOIT", "RETRY")


When I do that (substituting one of my valid GLOBAL vars
for FLAG) I get a formula evaluation return of "!" when
I try to verify the formula.

That would make me think it doesn't work, or is that
just the case when trying to validate GOTOs?

These are the kinds of errors that drive me up the wall.
I don't mind struggling when I'm doing something wrong,
but when it seems like all is well and it still doesn't
work, I want to pull hair! Unfortunately I'm bald so
that isn't even an option

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: January 09 2009 at 02:49 | IP Logged Quote grif091

Post your macro statement. This works in my Goto Label .....

(if (ph_getglobal_s("GVSTATE")="DONE","ENDMACRO","CONTINUE"))

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

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: January 09 2009 at 10:00 | IP Logged Quote GadgetGuy

Lee-

Thanks! Sometimes the most obvious is also the most
obscure!

I've been automatically selecting "Function" for the
Macro Command field for so long I just automatically did
that, instead of the proper JUMP or GOTO LABEL choice.

So of course my jumping efforts were failing.

Your inclusion of
Quote:
This works in my Goto Label
.....
was a proper dope slap for me and cleared
up the problem.

At last I have a recursive routine that keeps reading my
Insteon Thermostat until it gets a valid data set. The
STAT seems to be the most un-reliable Insteon device I
have, even though it is located only 3 feet from an
Access Point repeater.

Now I think I can get good data (or die trying!)


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

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