mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2007
Posts: 214
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Hello,

I was wondering wether or not there was a way to short this huge if statement

Code:
  ;elseif ($5 == LANGUAGE) { var %l = $remove($6,:) | if (%l == en) { %l = English } | if (%l == NL) %l = Dutch | if (%l == JA) %l = Japanese | if (%l == DE) %l = German | if (%l == AR) %l = Arabic | if (%l == FR) %l = French | if (%l == ES) %l = Spanish | echo %w $chr(149) Language: %l | halt }


Thanks a bunch.

Cheers,

Jay

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

Code:

elseif ($5 == LANGUAGE) {
  var %v1 = EN NL JA DE AR FR ES,%v2 = English Dutch Japanese German Arabic French Spanish
  echo %w $chr(149) Language: $iif($findtok(%v1,$remove($6,:),1,32),$gettok(%v2,$v1,32),Unknown)
  halt
}



Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
I was thinking something like:
Code:
elseif ($5 == LANGUAGE) { echo %w $chr(149) Language: $replace($remove($6,:),en,English,NL,Dutch,JA,Japanese,DE,German,AR,Arabic,FR,French,ES,Spanish) | halt }

Good luck.


I've gone to look for myself. If I should return before I get back, please keep me here.
Joined: Oct 2007
Posts: 214
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Thanks very much for the great help =)

Cheers,

Jay

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You should be using $replacex.

JA -> Japanese -> JapanSpanishe

-genius_at_work


Link Copied to Clipboard