IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Bruce Peaslee on December 15, 2005, 05:36:49 PM

Title: Switch / Case
Post by: Bruce Peaslee on December 15, 2005, 05:36:49 PM
Is the switch/case construct operational? The highlighting works, but my coding doesn'tÂÃ,  ???
Title: Re: Switch / Case
Post by: Zen on December 15, 2005, 05:58:01 PM
it may have something to do with the Scintilla control. There are about a million and one settings you can change on the control. I would guess that with it being an alpha version things like that are not a priority and will probably get sorted out later. I dont think select / case is in the syntax. The correct method is select and case, as it is in IBasic.

Lewis
Title: Re: Switch / Case
Post by: Ionic Wind Support Team on December 15, 2005, 06:32:19 PM
Actually it is as follows:

Select expr
{
    case xx:
        do something;
    case yy:
        do something else;
     case zz:
     case &ww:
        do this;
      default:
         blah;
}


Which is close to C syntax.  case& groups statments together.  Each case statment must be terminated with a colon as above.

'switch' is highlighted because I used the default C highlighter in Scintilla, modified to include Aurora keywords.

Paul.
Title: Re: Switch / Case
Post by: Bruce Peaslee on December 15, 2005, 10:05:35 PM
That does it.

"C++ in 10 Minutes" isn't turning out to be much of a bargainÂÃ,  ;)
Title: Re: Switch / Case
Post by: Parker on December 15, 2005, 10:19:59 PM
What I find works best is to try to find combinations of C and IB. For example:
struct x,1 {...
The keyword 'struct' is borrowed from C, the syntax of putting the packing in the format ",pack" is from IB, Aurora uses curly braces to designate blocks (C).
Title: Re: Switch / Case
Post by: Ionic Wind Support Team on December 15, 2005, 10:30:17 PM
I'll probably enable the keyword 'switch' as an alias for 'select'.  Just to aid in converting code.
Title: Re: Switch / Case
Post by: Steven Picard on December 16, 2005, 07:46:37 AM
Thanks, Paul.  I tried using 'switch' and couldn't understand why it didn't work and thought maybe it wasn't implemented yet.  ;D  The alias would be useful.
Title: Re: Switch / Case
Post by: Ionic Wind Support Team on December 16, 2005, 08:09:04 AM
It has been done ;)

In the next update you can use either 'switch' or 'select'