Register | Login
Forum Index > Requests and Feedback > case & string
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[676] case & string - posted: 2011-11-12 21:13:34

sometimes i need to use case statement with a string
Code:
 
  pointer st = Ziron_GetStringValue();
  case (st) {

          state 'mystring':
                 ........
                 ........
                 brack; 
 


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[692] - posted: 2011-11-15 19:50:31
I may consider adding this, but not in any upcoming releases because i first need to finish optimizing other routines and finish adding the rest of the feature set, this feature is more of a high level helper (which will be good for simple tasks)

btw, it would be much better/faster to check manually something like:

Code:
//input
str = 'mystring';

//code
eax = str;
case (char[eax]) {
  state "m":
    if (char*[eax] == "myst" and char*[eax+4] == "ring") {
      //
    }
    break;

  state ....
}


I will hopefully add case on base expressions in an upcoming beta.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[693] - posted: 2011-11-15 19:55:27

nice work around .

http://www.freewebs.com/ogremagic/index.htm
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 9 user(s) online. 0 member(s) and 9 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd