Searching \ for '[SX] Nested IF statements' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/devices.htm?key=sx
Search entire site for: 'Nested IF statements'.

Exact match. Not showing close matches.
PICList Thread
'[SX] Nested IF statements'
2006\10\10@100033 by John Kauffmann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, John Kauffman wrote:

In SX/B (IDE ver 3.2) is there a trick to nesting IF...THEN statements?
Doesn't seem to be a warning in the IDE help, but no examples of nested in help
I have searched forum for "nest if" and "nested if" but without results.

There is a nested example in the CLock/Timer sample.


This first one works fine:

if RB.3 = 1 then
 pause 1
endif


This second one fails, throwing a 26 error at the second EndIF (last line below)
if RB.3 = 1 then
pause 1
  if RB.4 = 1 then
      pause 1
  endif
endif


Error 26 from help:



Error 26

ELSE OR ENDIF WITHOUT IF.  You have used ELSE or ENDIF without a corresponding IF.


---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=148496
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\10\10@101742 by Sparks-R-Funn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote:

John,
I am not aware of a 'trick' to nesting If...Then statements.  I have nested many myself.

I copied the code from your second example into the main program body of the example template from the help file.  It compiled just fine for me.  I am using SX-Key 3.2 and not yet the latest version that was made available within the last few days.

- Sparks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=148496#m148501
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\10\10@104436 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

John,
 Older versions of the compiler had a problem with lowercase commands (I think IF..THEN..ELSE..ENDIF were ones).
 Try either the latest compiler (1.51.03) or make them uppercase.

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=148496#m148508
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\10\10@115210 by John Kauffmann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, John Kauffman wrote:

Correct, as always, Bean.
Changing to upper case did the trick.
I will check on 1.51.03 compiler tomorrow.

BTW, is there a wish list kept somewhere for improvments to the user IDE interface?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=148496#m148525
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\10\10@115212 by John Kauffmann/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, John Kauffman wrote:

Correct, as always, Bean.
Changing to upper case did the trick.
I will check on 1.51.03 compiler tomorrow.

BTW, is there a wish list kept somewhere for improvments to the user IDE interface?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=148496#m148526
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...