A string that holds my array?
#1

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?
Reply
#2

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.
Reply
#3

It is constant, as in, it doesn't change.

Is there any other way to do this?
Reply
#4

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?
Reply
#5

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
};
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)