ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
IF, THEN, ELSE....OR MAYBE NOT?
Kevin Trainor
Tue, 14 Nov 2000 22:47:29 -0600
Tue, 14 Nov 2000 22:47:29 -0600
All:

When you can't even make the IF-AND-ELSE statements work in a language, I think you
should generally be regarded as a failure.  Such is my fate with ECS.  Oh, I've tried
to make them work.  And, some have.  I've had especially good luck with the simple IF-THEN
construct.  I have even had some luck with your basic IF-THEN-ELSEIF construct.  But,
as soon as I try to do something complex, the event goes right into the toilet.

I've tried looking at the event code that comes with ECS.  And, suspiciously, I can't
find any examples of IF-THEN-ELSE constructs that are more complex than the ones that
I described above.  The proud programmer in me suspects that perhaps even Mark can't
get the complex ones to run right.  But, the humble programmer in me says that I probably
am just not getting the language syntax and that it's all my fault.

So, on to my questions:

1.  What is the proper way to code a block of statements to be executed in the ELSE
case?  Is it:

if condition
then statement 1
then statement 2
else statement 3
else statement 4
else statement 5

or perhaps is it:

if condition
then statement 1
then statement 2
else statement 3
do statement 4
do statement 5

2.  When expressing conditions using AND / OR, can you create a complex statement that
would normally be created using paretheses in more robust languages?  Are there rules
that determine the order of precedence?  If not, how do people create complex conditionals
in ECS?

3.  Can you use an ELSEIF within a BEGINIF-ENDIF block?

4.  I have the same question about coding blocks of statements for the ELSE case as
it applies to BEGINIF-ENDIF.  Do all statments within the ELSE case begin with ELSE?

5.  Are there limits to how deeply IF-THEN-ELSE statements can be nested?

6.  WHY DOESN'T MY CODE EVER DO WHAT I EXPECT IT TO UNLESS I MAKE IT SO REPETITIVE AND
TEDIOUS THAN I FALL ASLEEP CODING IT?

Well...Now that I have all that off my chest, I would like to ask for your help.  If
you have had these kinds of problems and found your way through, I would appreciate
your advice.

Thanks in advance.

Kevin






All:
 
When you can't even make the IF-AND-ELSE statements work in a language, I think you should generally be regarded as a failure.  Such is my fate with ECS.  Oh, I've tried to make them work.  And, some have.  I've had especially good luck with the simple IF-THEN construct.  I have even had some luck with your basic IF-THEN-ELSEIF construct.  But, as soon as I try to do something complex, the event goes right into the toilet.
 
I've tried looking at the event code that comes with ECS.  And, suspiciously, I can't find any examples of IF-THEN-ELSE constructs that are more complex than the ones that I described above.  The proud programmer in me suspects that perhaps even Mark can't get the complex ones to run right.  But, the humble programmer in me says that I probably am just not getting the language syntax and that it's all my fault.
 
So, on to my questions:
 
1.  What is the proper way to code a block of statements to be executed in the ELSE case?  Is it:
 
if condition
then statement 1
then statement 2
else statement 3
else statement 4
else statement 5
 
or perhaps is it:
 
if condition
then statement 1
then statement 2
else statement 3
do statement 4
do statement 5
 
2.  When expressing conditions using AND / OR, can you create a complex statement that would normally be created using paretheses in more robust languages?  Are there rules that determine the order of precedence?  If not, how do people create complex conditionals in ECS?
 
3.  Can you use an ELSEIF within a BEGINIF-ENDIF block?
 
4.  I have the same question about coding blocks of statements for the ELSE case as it applies to BEGINIF-ENDIF.  Do all statments within the ELSE case begin with ELSE?
 
5.  Are there limits to how deeply IF-THEN-ELSE statements can be nested?
 
6.  WHY DOESN'T MY CODE EVER DO WHAT I EXPECT IT TO UNLESS I MAKE IT SO REPETITIVE AND TEDIOUS THAN I FALL ASLEEP CODING IT?
 
Well...Now that I have all that off my chest, I would like to ask for your help.  If you have had these kinds of problems and found your way through, I would appreciate your advice.
 
Thanks in advance.
 
Kevin
 



  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.