Array length
#1

Hi guys,

how long can be an array?

I've got an array (field) in my script that is defined with

new field[110][128];

but I think it doesn't work, because I tested it so:

print("nothing");
new field[110][128];
print("field"); (<-- it's not desplayed in the server monitor)

Could that be?

Greez, selEcT
Reply
#2

Lets go back to basics...

If you want to just store a string (some text) then do this:

pawn Код:
new field[32];
In simple terms the 32 part means it can store up to 32 characters.

When you want to view the contents of your variable in the server console do this:

pawn Код:
printf("My field variable is: %s", field);
Hope this gets you on track.

Reply
#3

I think you don't understand.

here: http://www.strickenkid.info/mysql_plugin/example.pwn

He has "new field[4][32]" and I'd like to have "new field[110][32]" (110 fields with a string length of 32). But it doesn't work.. WHY?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)