case label
#1

this is code



this is error

Код HTML:
C:\Users\Gigi\Desktop\New folder\gamemodes\Fletcher2.pwn(104) : error 040: duplicate "case" label (value 97)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
rep++
Reply
#2

Change "Switch" to "while" on line 104.
Reply
#3

dont work..
Reply
#4

I can't even see what is on the case line (copy paste the switch in here)
But the errors just states that you did something like that "case 97, 97" (97 is equivalent with 'a')
Reply
#5

Код HTML:
case   'A'..'Я', 'a'..'я', ' ': return ShowPlayerDialog(playerid, 1, DSM, "Shecvale", "shecvle rasklakidebi", "gaimeore", "");
also that switch

Код HTML:
switch(inputtext[i])
Reply
#6

I dont SEE why its dyplicated but i guess its possible that SPACE character in ASCII table is in between A and YA characters so thats why it say DUPLICATED CASE LABEL 97.

If im right removing ' ' will solve problem, but if im not try using if
pawn Код:
if(inputtext[i] >= 'A' && inputtext[i] <= 'Я' ||
   inputtext[i] >= 'a' && inputtext[i] <= 'я' || inputtext[i] == ' ') return ShowPlayerDialog(playerid, 1, DSM, "Shecvale", "shecvle rasklakidebi", "gaimeore", "");
Im pretty sure that these is not the best way to validate Russian letters as A belongs to English while YA to Russian and in between there can be some other letters (Arabian, Chinise, Italian...etc...)
Reply
#7

i got warning on this line

Код HTML:
inputtext[i] >= 'a' && inputtext[i] <= 'я' || inputtext[i] == ' ') return SPD(playerid, 1, DSM, "Shecvale" "shecvla rasks", "gaimeore", "");
Код HTML:
C:\Users\Gigi\Desktop\New folder\gamemodes\Fletcher2.pwn(103) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#8

If im not mistaking its due to loop.

Just add if inside curve brackets
pawn Код:
for(new i = sizeof(inputtext)-1; i >= 0; i--)
{
   if(inputtext[i] >= 'A' && inputtext[i] <= 'Я' ||
      inputtext[i] >= 'a' && inputtext[i] <= 'я' || inputtext[i] == ' ') return ShowPlayerDialog(playerid, 1, DSM, "Shecvale", "shecvle rasklakidebi", "gaimeore", "");  
}
EDIT: Im pretty sure your loop will get into overflow at start :P (FOR loop doesn't consider --i, its treated as i--, well at least in C/++ and php as far as i know, so just use what's SAFE :P)
Reply
#9

After a little search I found out that the Cyrillic script also starts with some kind of an A

The problem you have is that you took the latin A and not the cyrillic А

That should be the version with the correct А and а (they look identical to me)
pawn Код:
case 'А'..'Я', 'а'..'я', ' ':
You will notice the problem in one of the codepages

http://de.wikipedia.org/wiki/Windows-1251
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)