FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Suggestions
   Software Suggestions
(Moderator: fry)
   String Switch?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: String Switch?  (Read 578 times)
Mythmon


String Switch?
« on: May 29th, 2004, 12:44am »

im working a project and i have found that i am using multible if/then/else statements to check if a single variable is  certain values, now i know that this is what switch does, but the variable im using is a string, and apparently switch doesnt like strings, does anyone have a hack/function that lets switch use strings or can someone tell me im an idiot and that im doing it wrong, or if its not possible can fry or someone else on development consider adding it in?
 
thanks in advance!
 
mflux

fluxhavoc WWW
Re: String Switch?
« Reply #1 on: Jun 3rd, 2004, 6:13am »

It's a stupid idea but you can convert the string into numbers, pass it through a switch...
 
Not sure what's so bad about using many if statements but it does make sense for convenience purposes for switch to take strings.
 
Pages: 1 

« Previous topic | Next topic »