Strings in switch case statements

Poison

New member
Messages
45
Points
0
Github
pois8n
Emulator
Something like this:

Code:
[URL="http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html"]http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html[/URL]
 
that has been suggested when there were only rA, but it got rejected, can't remember why, lets wait for devs
default_smile.png


 
I can't see why not to implement this in our script engine, but I'm not so sure of what are the real implications of such modification performance/resource-wise...

 
dont see the point or neccessarity of this.

i more prefer a switchcase with enums if i realy need words on the spots. but strings.... this doesnt feel correct.

 
dont see the point or neccessarity of this.

i more prefer a switchcase with enums if i realy need words on the spots. but strings.... this doesnt feel correct.
Source supports enums, what about Scripts? scripts only support numbered switch cases(and constants)

setting up constants for scripts is not good(As far as I am concerned).[Constants also don't support strings(For Scripting)]

 
Last edited by a moderator:
It can maybe wrong,

but if a feature is so hugh, that it needs those advanced technologies, should it be a script?

i think if something is so hugh (and i would count the new bg system to this) it should not be a script, it should be a map-server logic.

Greetings

Tepoo

 
It can maybe wrong,

but if a feature is so hugh, that it needs those advanced technologies, should it be a script?

i think if something is so hugh (and i would count the new bg system to this) it should not be a script, it should be a map-server logic.

Greetings

Tepoo
Maybe you misunderstood my words, Its definately a source modification but it is used with script like for example

OnPCTalk:switch (strcharinfo(0)){case "ItsME"://Do somethingbreak;case "ItsNotME"://Do somethingbreak;default://Do somethingbreak;}
(Just a example....)

 
>was scripting, it does not work

>i googled, this shows

>bump, lol

 
Back
Top