mIRC Home    About    Download    Register    News    Help

Print Thread
#195771 02/03/08 02:17 AM
B
Buggs2008
Buggs2008
B
I am familiar with the IF statement but having to go through a list, like this I dont think would be the best way to do it, any advice?

elseif ($5 == LANGUAGE) {
var %l = $4-
if ($4 == EN) %l = English
if ($4 == NL) %l = Dutch
if ($4 == JA) %l = Japanese
if ($4 == DE) %l = German
if ($4 == AR) %l = Arabic
if ($4 == FR) %l = French
if ($4 == ES) %l = Spanish
echo $2 11• Language11: %lang
}

Joined: Jul 2006
Posts: 4,038
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,038
use $replace :
Code:
var %l = $replace($4-,EN,English,NL,Dutch,JA,Japanese,DE,German,AR,Arabic,FR,French,ES,Spanish)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 2,002
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,002

French is going to come out as FrEnglishch

Japanese is going to come out as JapanSpanishe

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
What you've never heard of FrEnglishch?

Joined: Dec 2002
Posts: 2,002
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,002

It's my 2nd language after Typonese. grin

5
5618
5618
5
lol

Well, you can always use $replacecs() for a case-sensitive replacement. wink

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
Use $replacex instead.

"Replaces any occurrence of substring in string with newstring except for replacements that have already been made"

-genius_at_work

Joined: Jul 2006
Posts: 4,038
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,038
Yes i'm aware about that, i just don't look at the words carefuly when i wrote my post, sorry :].
As mentioned, $replacex should be used


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard