Jump to content

adding subroutine programming construct


xd40

Recommended Posts

you said "call", I suspect you meant "run" as that's the only option I see.

 

But the distinction is that if I "run" the other program from a program, it DOES NOT return to the calling program.

 

It originally took me hours to figure out why my code wasn't working until I understood that the execution does not return from a "run" (that was a year or so ago).

Link to comment

xd40,

 

Just to be sure, I created a test program which calls 3 different programs each one of which send an email to a different recipient:

 

If
       Status  'adf / blah blah' is On

Then
       Run Program 'email 1' (Then Path)
       Run Program 'email 2' (Then Path)
       Run Program 'email 3' (Then Path)

Else
  - No Actions - (To add one, press 'Action')

 

 

This works as expected. As I mentioned, unless the condition causes the program to stop, all programs should be called in sequence. i.e if the status of the lamp adf/blah blah becomes off during the execution then everything stops.

 

With kind regards,

Michel

 

pseudo code example:

 

Program1

do thing x

do thing y

run program2

do thing z

 

Program2

do thing a

do thing b

Link to comment

The execution ends as soon as the condition of the calling program becomes false.

 

That's interesting. Nothing like making the outcome of a "function call" non-deterministic based on some external event that you've already tested against. I guess that makes sense in somebody's world--just not mine.

 

I have a computer science degree over 25 years programming experience and I have to say that the home automation world has a very odd concept of what a programming language should look like. I should know by now that when your "programming" is constrained by a menu driven "program builder" that there are going to be significant limitations of that "language". i.e.:

 

- abnormal program flow

- no case statements

- no arrays

- no type conversion

- no function calls

- no math functions

 

- oh, and no variables...???

 

Why don't you guys consider embedding a LUA interpreter so we can write some of the functionality we need for ourselves? I still have a 10 year old X10 controller running all of my lawn sprinkler programs because the programs are too complex to implement on the ISY...

Link to comment
The execution ends as soon as the condition of the calling program becomes false.

 

The execution of the calling program quits but any called program will continue unless it is explicitly Stopped. This can be done using the Else actions.

 

Rand

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...