Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-16-2007, 02:50 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
The Spoils of the Switch and Case Statements

This is not a question thread at all but rather a thread to make the scripting community more aware of the power of using switch in your GS2 coding.

I'm also posting this because I don't want to steal the pride of a certain someone after he updated a certain wiki's switch statement page (by updating it my self).


Using the switch to do a case, break, case, break, case, break series is often common. But what people don't know is what you can do outside of such a series. Rather then try to explain it off the bat, I'll show you an example code I made on GK Debug (can't say what its for, sorry):

PHP Code:
LINE 01: switch (this.mystatus) {
LINE 02:   case 1:
LINE 03:   case 3:
LINE 04:   case 5:
LINE 05:     fnGetItem(1"board""boards");
LINE 06:   break;
LINE 07:   case 7:
LINE 08:   case 9:
LINE 09:     fnGetItem(1"iron""iron");
LINE 10:   break;
LINE 11:   default:
LINE 12:     true;
LINE 13:   break;
LINE 14: } 
Basically here is the rule for a switch:
When ever a case is encountered, if that case proves true, all the code following that case statement will be executed (from top to bottom) ignoring all following case statements. A break can be used to "jump out" of the switch to avoid executing unwanted statements of another case.

In a sense, a switch just jumps into the point that the correct case is found and jumps out at the first break found after that (if there is one).

Let's just jump into the code by presenting certain examples:

Let's say this.mystatus is 5:
The code when then start at line 4 and execute both line 5 and then line 6. At line 6 is a break so the switch then ends at that point.

Let's say this.mystatus is 8:
The switch contains no cases for 8 so it starts at the default (line 11). Lines 12 and and 13 are then executed. At line 13 is a break so the switch then ends at that point but keep in mind since this is the last "case" (so to speak) in the switch, the final break is really only there for looks (the switch would end regardless since it is the end).

Another thing to note about default: A switch will start at default if it has found no matching cases before. Thus, if you have any cases after the break in your default, they will always be ignored. For this reason, your default should go at the end of your switch no matter what (putting it at the beginning without a break would be just stupid because you could put that code segment before the switch).

Let's say this.mystatus is 1:
Now the switch starts at line 2 and continues on with the code from there. Following our rule (which says to ignore all following case's), it only executes lines 5 and 6 because lines 3 and 4 are both case's that will be ignored (a case was already found). Just like if this.mystatus was 3 or 5, this code will do the function on line 5 and then end the switch on line 6.

I think the rest is pretty self explanatory, if you have any questions though or are confused, please feel free to ask!

Hope this helps,
- Zero

EDIT:

Here is info on the basics of a switch for those that don't know:

The format for a switch can be read from above but you may not know how to implement it. Look at this:
PHP Code:
switch (this.myvar) { 
This is getting the contents of "this.myvar" and using it to compare to all the switch's case's. The variable (this.myvar) could be a float (number) or a string (series of letters, numbers and/or characters) too! I currently haven't tested if an array works (array members work just fine such as switch (this.myvar[2])) or if an object works. I'll have to get back to you on that.

Now the case's:
The case's should just match the variable type that you used in the switch. If the switch variable is a float, you should do something like I did in the above example. As for strings, here is a good example:

PHP Code:
LINE 01: switch (this.mystring) {
LINE 02:   case "abc":
LINE 03:   case "beans":
LINE 04:   case "ghi":
LINE 05:     fnGetItem(1"board""boards");
LINE 06:   break;
LINE 07:   case "jkl":
LINE 08:   case "I'm a donkey":
LINE 09:     fnGetItem(1"iron""iron");
LINE 10:   break;
LINE 11:   default:
LINE 12:     true;
LINE 13:   break;
LINE 14: } 
Make sense?
__________________
Do it with a DON!

Last edited by zokemon; 08-16-2007 at 12:18 PM..
  #2  
Old 08-16-2007, 03:27 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Nice work.
  #3  
Old 08-16-2007, 12:15 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Very nice Zero!
_____________________________
Oh, and for arrays:

This code will not work:

PHP Code:
function onCreated() {
  
temp.= {01};
  
  switch(
temp.a) {
    case {
01}:
      echo(
"foo");
    break;
  }

But, this code will work
PHP Code:
function onCreated() {
  
temp.= {01};
  
  switch(@ 
temp.a) {
    case @{
01}:
      echo(
"foo");
    break;
  }

__________________
  #4  
Old 08-16-2007, 08:27 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Chompy View Post
PHP Code:
function onCreated() {
  
temp.= {01};
  
  switch(@ 
temp.a) {
    case @{
01}:
      echo(
"foo");
    break;
  }

Its converting to string: "0,1"
__________________
  #5  
Old 08-16-2007, 09:04 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Inverness View Post
Its converting to string: "0,1"
:o
__________________
  #6  
Old 08-16-2007, 10:29 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Ya, isnt @ converting arrays to strings?
  #7  
Old 08-17-2007, 01:08 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
@ is only associated with strings yes so it converts any array into a string format (like you would see if it was saved in a text file).

Did you try like:

PHP Code:
function onCreated() {
  
temp.= {01};
  
temp.= {01};
  
  switch(
temp.a) {
    case 
temp.b:
      echo(
"foo");
    break;
  }

Because you can only use {} for arrays in certain cases (like assignments and in "in" [some other things too]). I know you can't do like:

PHP Code:
if (array == {"a""b""c"}) 
__________________
Do it with a DON!
  #8  
Old 08-21-2007, 02:36 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Oh sweet
I never knew I would be brought up in a thread nor be a script command
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
  #9  
Old 08-21-2007, 04:23 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Switch View Post
Oh sweet
I never knew I would be brought up in a thread nor be a script command
PHP Code:
zokemon (myvar) {
  
script "bean":
    
stuff();
  break;

__________________
Do it with a DON!
  #10  
Old 08-21-2007, 03:11 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Thats so good about you Switch. Though you are missing the most important function. You cannot be turned off...
  #11  
Old 08-21-2007, 08:56 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by zokemon View Post
PHP Code:
zokemon (myvar) {
  
script "bean":
    
stuff();
  break;

What? 0_0
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
  #12  
Old 08-21-2007, 09:09 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by coreys View Post
What? 0_0
It was a joke ;o
__________________
  #13  
Old 06-21-2009, 01:38 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Why was this never stickied?
__________________
Follow my work on social media post-Graal:Updated august 2025.
  #14  
Old 10-07-2010, 06:35 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Is it possible to do something like
PHP Code:
  switch(blah){
    case 
"blah" "blah"//if either are true then proceed
      
doStuff();
      break;
    default case 
"blah"//if either are true then proceed
      
doStuff();
      break;
  } 
  #15  
Old 10-07-2010, 06:37 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Cubical View Post
Is it possible to do something like
PHP Code:
  switch(blah){
    case 
"blah" "blah"//if either are true then proceed
      
doStuff();
      break;
    default case 
"blah"//if either are true then proceed
      
doStuff();
      break;
  } 
You can do that like this..

PHP Code:
  switch(blah){
    case 
"blah": case "blah2":
      
doStuff();
      break;
    case 
"blah3": default:
      
doStuff();
      break;
  } 
Drops read-ability quite a bit imo though.
__________________
Quote:
  #16  
Old 10-07-2010, 06:45 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by fowlplay4 View Post
You can do that like this..

PHP Code:
  switch(blah){
    case 
"blah": case "blah2":
      
doStuff();
      break;
    case 
"blah3": default:
      
doStuff();
      break;
  } 
Drops read-ability quite a bit imo though.
It was mainly just for my curiosity because I don't even have Graal installed right now. I was wondering for something along the lines of this.
PHP Code:
switch(cmd){
  case 
"command1":
    break;
  case 
"command2":
    break;
  case 
"help": default:  // if help or no params are given then continue
    
sendtorc("commandlist");
    break;

  #17  
Old 10-07-2010, 08:02 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Cubical View Post
It was mainly just for my curiosity because I don't even have Graal installed right now. I was wondering for something along the lines of this.
PHP Code:
switch(cmd){
  case 
"command1":
    break;
  case 
"command2":
    break;
  case 
"help": default:  // if help or no params are given then continue
    
sendtorc("commandlist");
    break;

Best way is to do it like this, as suggested in original post:

PHP Code:
switch (cmd) {
  case 
"command1":
  case 
"command2":
    
dostuff;
  break;
  
  default:
    
domorestuff;

either command1 or command2 will activate "dostuff;" and doesn't really hurt readability.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
  #18  
Old 10-07-2010, 07:30 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
I assumed that was just part of the example, I read it forever ago. Should have reread it.
  #19  
Old 10-08-2010, 03:55 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Sticky the thread already!
__________________
Follow my work on social media post-Graal:Updated august 2025.
  #20  
Old 10-08-2010, 05:15 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by xXziroXx View Post
Sticky the thread already!
Second and this should be added to the bible as well.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
  #21  
Old 03-01-2012, 09:18 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Seriously, is it possible to change the title of this to Switch and Case?
So then when I google Switch, or Case, I won't have to be redirected from another forum spot to here, and come here at the start?
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #22  
Old 03-01-2012, 09:32 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
You know the title now so you can use the forums search button
  #23  
Old 03-01-2012, 11:01 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Devil_Lord2 View Post
Seriously, is it possible to change the title of this to Switch and Case?
So then when I google Switch, or Case, I won't have to be redirected from another forum spot to here, and come here at the start?
Try using a bookmark; modern web browsers are very good at navigating the web, and, surprisingly, you're not the first person who has ever needed to save a page for later.

Also keep this page handy.
__________________
  #24  
Old 03-02-2012, 05:24 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by Cubical View Post
You know the title now so you can use the forums search button
I do not use the forums, I use google since it usually has more value then people telling others who are asking in the forums how to do something to search the forums. The searches, which by the way don't always turn up what you are looking for, aren't very great nor are they organized.

Then you can get into the many people who tell you to use the wikia and the bible which are even more horrible than the forums lol...

Also, you could have said that the first three times I had to search for it, not everyone remembers every single thing they find. ;]
I for one have horrible memory, and would rather look for "GS2 Graal Cases" on google. In turn that would send me to Astrams post about Switches on here, which you then have to scroll down to see someone saying to go to the spoils of switch... Redundant clicks which could be simplified by naming something correctly.


Quote:
Originally Posted by cbk1994 View Post
Try using a bookmark; modern web browsers are very good at navigating the web, and, surprisingly, you're not the first person who has ever needed to save a page for later.

Also keep this page handy.
I'm probably not the first person who has had to replace my hard drive in the last four weeks twice either.

And I highly doubt myself bookmarking it is going to help the others who might need this as well...








Thank you both for your help, you have both changed my life in some way. :]
I'd appreciate it if the question that was asked was actually answered instead of veering off topic next time however..

I can't say I appreciate the person who spammed my Green, Red, and Neutral bar comment thing though. At least comment in something relating to the reason of the picking...
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz




Last edited by Devil_Lord2; 03-02-2012 at 05:28 PM.. Reason: Thanks. :p
  #25  
Old 03-03-2012, 05:22 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Lol... I am told I am being an ass, because selfishly people are telling me to do things, when I'd like something done for everyone else to have easier access to this..

I'm welcome to more red bars if anyone likes.
And I'd still like the name to be changed so many people can find this easier.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #26  
Old 03-03-2012, 05:24 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by Devil_Lord2 View Post
Lol... I am told I am being an ass, because selfishly people are telling me to do things, when I'd like something done for everyone else to have easier access to this..

I'm welcome to more red bars if anyone likes.
And I'd still like the name to be changed so many people can find this easier.
Just bookmark it. The title is fine. Isn't this page bookmarked on the graal bible too?

Edit: It is! Bookmark this page: http://wiki.graal.net/index.php/Crea...rol_Structures
  #27  
Old 03-03-2012, 05:29 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by MattKan View Post
Just bookmark it. The title is fine. Isn't this page bookmarked on the graal bible too?

Edit: It is! Bookmark this page: http://wiki.graal.net/index.php/Crea...rol_Structures
I try not to use Graal Bible unless I absolutely have to, if you go to table of contents there is basically nothing when one should expect a list from A-Z of commands or topics lol... Also, searching for things on it doesn't seem reliable either... D:

Eventually I'd like to make a list of commands GS2 and 'better' details how to make everything. Thank you though..


Quote:
Originally Posted by cbk1994 View Post
Also keep this page handy.
By the way, I missed this, still not relating to my question, I'm glad you posted it. This does look like it has some useful things!

I might be turning my computer in for another due to the Lemon Law which I will have to look up on.. So I can just search for this page to find this lol..
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #28  
Old 03-03-2012, 05:41 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by Devil_Lord2 View Post
By the way, I missed this, still not relating to my question
  #29  
Old 03-03-2012, 05:42 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Dear mod who changed the thread title,

Since you're renaming it, please rename it to 'switch case statement' not 'switch and case statements'. What you've done is just wrong, considering no one (excluding special_lord2) around here has ever referred to it as a case statement.
__________________
Quote:
  #30  
Old 03-03-2012, 08:17 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by fowlplay4 View Post
Dear mod who changed the thread title,

Since you're renaming it, please rename it to 'switch case statement' not 'switch and case statements'. What you've done is just wrong, considering no one (excluding special_lord2) around here has ever referred to it as a case statement.
Isn't name calling a little uncalled for? And if you'd like to check around the posts, you are actually the only one who has used the word statement(s).

I have only said Switch and Case, and Switch, or Case.
If you are going to make fun of me, at least do it with a little bit more dignity lol...

Quote:
Originally Posted by Devil_Lord2 View Post
Seriously, is it possible to change the title of this to Switch and Case?
So then when I google Switch, or Case, I won't have to be redirected from another forum spot to here, and come here at the start?

Since the question is not registering through anyone's head, the question as stated basically asks to rename a thread. Renaming a thread on http://forums.graalonline.com/ has absolutely nothing to do with Graal Bible (Or so I believe).

Once again, is it possible that this thread get renamed to something a little more relevant?

---

Also, fowlplay4, I believe either you are seeing something that I am not, or if I am correct, the name was never changed and has always been "The Spoils of the Switch and Case". I'm not sure if statements were ever in it though..
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #31  
Old 03-03-2012, 09:17 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Devil_Lord2 View Post
Once again, is it possible that this thread get renamed to something a little more relevant?
The title is relevant enough and linked to in several places. The content is something you shall learn and then not forget again, and I don't think this any difficult either. There's not much to switch and case, but the information the thread provides is useful nonetheless.
  #32  
Old 03-03-2012, 09:34 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by Crow View Post
The title is relevant enough and linked to in several places. The content is something you shall learn and then not forget again, and I don't think this any difficult either. There's not much to switch and case, but the information the thread provides is useful nonetheless.
The linking may be true, but it isn't easily found in google which is the main search engine I think most people use, and as it is my main point since I personally don't find the websites that link it that useful.. Nor have I checked out how hard it is to find it on them, but I have tried searching for other things on them.

And you shouldn't speak for others about not forgetting things.
As I've said before, I've found and used this page quite a few times.. I've learned and used them for about 1-2 weeks afterwards and forgot them.

Coincidentally, I've also forgot most of GS2 after 4+ months of not having RC and not using GS2. And this happens often.. Even riding a bike isn't very easy for me each time on the first try. Everything starts off a little wobbly if you don't keep at it..

I can explain the top part if you'd like, fowlplay4 would be happy.

And sure, I suppose it is relevant if everyone is basically saying we should not use switch and case because it isn't good.. I personally find it of value some times.. :[

===


Anyway, if no one really cares about how easily something useful can be found, without having things bookmarked, I suppose my question really doesn't matter. I didn't think the post would be worthy of arguments by only asking to rename a thread, it all seems silly to me.

But I did enjoy everyone flaming me while they were off topic, and I did get to learn about a helpful page. Thanks again Mattkan!

P.S.: I did check on the main page to find the post that you linked, I have no clue how you would find it on Graal Bible without having the actual link.. x.x;
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #33  
Old 03-03-2012, 09:43 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Regardless the title is still bad and I do not like it.

P.S.: Write less, nobody gives a **** about your constant life stories, how you can't remember anything, how something makes you feel, etc. If they did you would have 5 light green rep bars already.
__________________
Quote:
  #34  
Old 03-03-2012, 09:47 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Devil_Lord2 View Post
The linking may be true, but it isn't easily found in google which is the main search engine I think most people use
Boo hoo. Seriously, who searches on Google for GS2 help? The thread comes up when searching for "switch" here on the forums, that should be more than enough.


Quote:
Originally Posted by fowlplay4 View Post
P.S.: Write less, nobody gives a **** about your constant life stories
^
  #35  
Old 03-03-2012, 11:26 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Devil_Lord2 View Post
The linking may be true, but it isn't easily found in google
Which Google are you using?

__________________
  #36  
Old 03-03-2012, 06:26 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by fowlplay4 View Post
Regardless the title is still bad and I do not like it.

P.S.: Write less, nobody gives a **** about your constant life stories, how you can't remember anything, how something makes you feel, etc. If they did you would have 5 light green rep bars already.
I want people to give me bad rep, (didn't know what it was called), since I feel others use it for no real purpose, and it doesn't seem to have one.

Sorry though, it seems I have upset you greatly, didn't mean to get to you that bad.


Quote:
Originally Posted by Crow View Post
Boo hoo. Seriously, who searches on Google for GS2 help? The thread comes up when searching for "switch" here on the forums, that should be more than enough.
Someone who wants to find things quickly I suppose. ;]

Although one could also argue you aren't learning anything by doing so.. Seeing it often enough is learning, and it isn't like I don't know what they do.


Quote:
Originally Posted by cbk1994 View Post
Which Google are you using?

I use www.google.com, but since there are so many, I guess I can see how you could see how there could be mixed signals of some sort..

Edit-
Oh look above, I've clicked the ones I thought would be relevant, didn't help at all.. Anything I search for I use "GS2 Graal" and the command I'd like to figure out or refresh on.

Add in "and case" and you find my page for scripting help faster than you find this one..
Attached Thumbnails
Click image for larger version

Name:	Google2.0.png
Views:	259
Size:	196.6 KB
ID:	54318  
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz




Last edited by Devil_Lord2; 03-03-2012 at 06:29 PM.. Reason: Oh look above, I've clicked them.
  #37  
Old 03-03-2012, 06:30 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
seriously?
__________________
  #38  
Old 03-03-2012, 06:31 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Devil_Lord2 View Post
Someone who wants to find things quickly I suppose. ;]
GS2 is a very minor language, you really shouldn't use Google to find out things about it.


Quote:
Originally Posted by Devil_Lord2 View Post
Oh look above, I've clicked the ones I thought would be relevant, didn't help at all.. Anything I search for I use "GS2 Graal" and the command I'd like to figure out or refresh on.
You need to refine your search. Learn how to search on Google efficiently, there are a couple guides about it. "Switch" is too common a word to just search for it. In this case, "switch statement" works wonders, like in Chris' query.
  #39  
Old 03-03-2012, 09:15 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Salesman, it is really hard for me not to be sarcastic about your comment.
So I will only say, I wouldn't have posted if I didn't think it would help anyone.

Quote:
Originally Posted by Crow View Post
GS2 is a very minor language, you really shouldn't use Google to find out things about it.




You need to refine your search. Learn how to search on Google efficiently, there are a couple guides about it. "Switch" is too common a word to just search for it. In this case, "switch statement" works wonders, like in Chris' query.
I have learned to use search engines, which is why I'm only using three words lol.. for the most part, searching GS2 Graal and anything turns out what ever I need.

Unless it links me to the wiki or Graal bible, then the results are usually not the solution.. However, it does take me to the forum in spots that I need or that can help..

I use to have commands 2.RTF and an old GS1 list, but once again my computer was wiped.

Next time, should I remember, I'll try GS2 Graal Switch Statement. The only problem is, since I don't use the word statement for GS2, it never comes to mind. x:

Honestly, I'm still unclear why the word statement keeps coming up lol..
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



  #40  
Old 03-03-2012, 09:25 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Devil_Lord2 View Post
Honestly, I'm still unclear why the word statement keeps coming up lol..
http://en.wikipedia.org/wiki/Stateme...puter_science)
__________________
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.