17.05.2011, 04:15
I recently find a new problem on 2D array again.
Works fine and you can change the values of testarr[test2],
but when the testarr goes 2D,
Gives out compiler errors:
All errors occurs on that format(trying to change the value of that string).
Single cell access seems to be working but you can't change the whole string.
Weird..
pawn Код:
enum test
{
test1,
test2[128]
}
public OnFilterScriptInit()
{
new testarr[test] =
{
1,"hello world!"
};
print(testarr[test2]);
testarr[test2][0] = '\0';
format(testarr[test2],sizeof(testarr[test2]),"helloworld!!");
print(testarr[test2]);
return 1;
}
but when the testarr goes 2D,
pawn Код:
[enum test
{
test1,
test2[128]
}
public OnFilterScriptInit()
{
new testarr[1][test] =
{
{1,"hello world!"}
};
print(testarr[0][test2]);
testarr[0][test2][0] = '\0';
format(testarr[0][test2],sizeof(testarr[0][test2]),"helloworld!!");//Line 31
print(testarr[0][test2]);
return 1;
}
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test.pwn(31) : error 001: expected token: "]", but found "-integer value-" C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test.pwn(31) : warning 215: expression has no effect C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test.pwn(31) : error 001: expected token: ";", but found "]" C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test.pwn(31) : error 029: invalid expression, assumed zero C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test.pwn(31) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Single cell access seems to be working but you can't change the whole string.
Weird..