Raised This Month: $ Target: $400
 0% 

Vector/array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-05-2007 , 17:16   Re: Vector/array
Reply With Quote #10

no, you cant delcare any varriable with an empty array "[]" without initializing it. Because you will get a compile error. The only reason "[]" exsists it tell the compiler to determine the required length for the string so you dont have to type it in, which it can only do if you have the string you want it to analyze there at the time.

fix:
Code:
new StrName[5] = "TEST" //TEST is only four characters, why make a 255 slotted array? new StringArray[10][5]; StringArray[1] = "poop" //only index the first array of your multidimensional array StringArray[2] = StrName //as long as the string is smaller or the same size as you second dimension, it will work.
But i am not sure you can do this in PAWN or not, or if it is safe...'

So do this instead:
Code:
new StrName[5] = "TEST"; new StringArray[10][5]; //[how many strings][length of string] copy(StringArray[1], 4, "poop"); copy(StringArray[2], 4, StrName);
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode