March 28, 2024, 12:54:05 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Switch / Case

Started by Bruce Peaslee, December 15, 2005, 05:36:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

Is the switch/case construct operational? The highlighting works, but my coding doesn'tÂÃ,  ???
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Zen

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

Ionic Wind Support Team

December 15, 2005, 06:32:19 PM #2 Last Edit: December 15, 2005, 06:35:32 PM by Ionic Wizard
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.
Ionic Wind Support Team

Bruce Peaslee

That does it.

"C++ in 10 Minutes" isn't turning out to be much of a bargainÂÃ,  ;)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

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).

Ionic Wind Support Team

I'll probably enable the keyword 'switch' as an alias for 'select'.  Just to aid in converting code.
Ionic Wind Support Team

Steven Picard

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.

Ionic Wind Support Team

It has been done ;)

In the next update you can use either 'switch' or 'select'
Ionic Wind Support Team