mIRC Home    About    Download    Register    News    Help

Print Thread
#195771 02/03/08 02:17 AM
Joined: Oct 2007
Posts: 214
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

French is going to come out as FrEnglishch

Japanese is going to come out as JapanSpanishe

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


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

It's my 2nd language after Typonese. grin

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
lol

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

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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