dopeness Posted December 14, 2012 Share Posted December 14, 2012 Hi, could you write up a simple example of how to use Arrays in Scar. I'd need an example for Strings, Integers and anything else. Thanks. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 14, 2012 Share Posted December 14, 2012 (edited) Small example: var fruits: TStrArray; begin ClearDebug; fruits := ['Apple', 'Orange', 'Banana', 'Pear']; // Indexes 0, 1, 2, 3. WriteLn('Random fruit: ' + fruits[Random(4)]); // Random returns 0-3 with value 4. SetLength(fruits, 0); end. You can also do this: var fruits: TStrArray; begin ClearDebug; SetLength(fruits, 4); fruits[0] := 'Apple'; fruits[1] := 'Orange'; fruits[2] := 'Banana'; fruits[3] := 'Pear'; WriteLn('Random fruit: ' + fruits[Random(4)]); // Random returns 0-3 with value 4. SetLength(fruits, 0); end. Also, here is couple great video tutorials for arrays (dynamic and static arrays): Done with old SCAR, but using arrays works still the same way in SCAR Divi 3.35+. Edited December 14, 2012 by Janilabo Quote Link to comment Share on other sites More sharing options...
dopeness Posted December 14, 2012 Author Share Posted December 14, 2012 Thanks. Also (not related to Arrays) is there a function similar to findBitmapTolerance in the new Scar Version? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 14, 2012 Share Posted December 14, 2012 Yes, there is FindBitmapTol(). In SCAR's script editor write "find" and then press CTRL + SPACE so you will see list with almost all of the finding functions. I recommend taking a look at changelog aswell: http://svn.scar-divi.com/scar/changelog.txt (You can see there what has been renamed in the past) Quote Link to comment Share on other sites More sharing options...
dopeness Posted December 14, 2012 Author Share Posted December 14, 2012 Yes, there is FindBitmapTol(). In SCAR's script editor write "find" and then press CTRL + SPACE so you will see list with almost all of the finding functions. Oh god, thanks so much. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 14, 2012 Share Posted December 14, 2012 No problem mate, anytime! Quote Link to comment Share on other sites More sharing options...
dopeness Posted December 14, 2012 Author Share Posted December 14, 2012 Another quick question. The cooridinate values are still the same, correct? so: 1,1,5,5. Essentially we're creating a box to search in? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 14, 2012 Share Posted December 14, 2012 Yep, they are still the same. Quote Link to comment Share on other sites More sharing options...