A string that holds my array? -
Shoulen - 18.04.2013
Hi,
I'm not sure if this is possible or not, but basically this is what I have:
pawn Код:
string = "{1},{2},{5},{7},{25]";
And with it I was hoping to be able to do this:
pawn Код:
new MyArray[][1] = {
string;
}
How can I go about doing this and getting that effect so to use the string as a place holder for the arrays?
Re: A string that holds my array? -
Vince - 18.04.2013
All strings are arrays, but not all arrays are per definition strings. Anyway, you can't initialize a variable with another variable unless it's constant.
Re: A string that holds my array? -
Shoulen - 18.04.2013
It is constant, as in, it doesn't change.
Is there any other way to do this?
Re: A string that holds my array? -
Shoulen - 18.04.2013
The const isn't really what I'm looking for,
I've just done it a different way with loops.
I have another question if you don't mind,
The string that pulls these array formats are really big, 2 bytes big, and obviously I cannot create a string and declare an index of 32767, how can I pull a string is, literally 32000 characters long +- without crashing the script?
Re: A string that holds my array? -
MP2 - 18.04.2013
Not 100% sure what you need, but if it's constant, why use an array and not a define?
pawn Код:
#define string 1, 2, 5, 7, 25
new MyArray[] = {
string
};
Re: A string that holds my array? -
Sithis - 18.04.2013
If you'd tell us what you want to do, we'd likely be able to tell you a much better way of doing that.