SRL Archive - OSR Help

hi, i dont usually code in scar but, how do arrays work in it?


dopeness

2010-04-09 08:53:34

all help would be appreciated :) thanks

i luffs yeww

2010-04-09 10:24:09

http://villavu.com/forum/showthread.php?t=32182 (Specifically a TPA tutorial.)
http://villavu.com/forum/showthread.php?t=28436 (This is probably what you want.)

trecool999

2010-04-09 10:31:15

You code in Pascal, not SCAR.


ArrayOfNumbers : Array of Integer;
ArrayOfSentences : Array of String;
AnotherArrayOfNumbers : Array[0..10] of Integer; //Makes an array that has values AnotherArrayOfNumbers[0] all the way up to AnotherArrayOfNumbers[10]

Bionicle

2010-04-09 17:27:13

From: trecool999
You code in Pascal, not SCAR.


ArrayOfNumbers : Array of Integer;
ArrayOfSentences : Array of String;
AnotherArrayOfNumbers : Array[0..10] of Integer; //Makes an array that has values AnotherArrayOfNumbers[0] all the way up to AnotherArrayOfNumbers[10]


ArrayOfNumbers := [1, 25, 3, 6, 2 ,36];
ArrayOfSentences := ['string1', 'string2', 'string3'];
AnotherArrayOfNumbers := [2, 6, 23, 36, 43, 2, 24, 34, 15, 26, 11];

Then you call them like:

ArrayOfNumbers[2]; //will be 3
ArrayOfSentences := [2]; //Will be 'string3'