shadowrecon Posted December 30, 2011 Share Posted December 30, 2011 (edited) Okay so ive been going through the Library's and looking at the functions, and messing around with them. I Came across the TPA function and figured oh cool, so i can just set up an array of points with data and the pull the data later. Didnt seem to work as i thought tho. In C++ you can define the array, set the data, and then call it back latter in the program as long as the array was initialized as global variable. So something like this Array[9] = array; // making 10 spots starting at zero void function{ .... fill array [0] - [9]; .. } void loop { int = i; i == Array[4]; // Lets say Array[4] contains the number 3 and is set to i i++ // i is increased by 1 println(i); // now i is printed and contains 4 } (obviously this has no real point just an example i type up really quick =P) Can i get the same functionality out of scar like c++? or do i need to go about storing values another way? and if so whats the best method to store values in a function and call them later in the script or program? Thank You Sorry for the inconvenience i may cause =/ Edited December 30, 2011 by shadowrecon Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 30, 2011 Share Posted December 30, 2011 Dunno if this helps but here's some random code var TIA: TIntegerArray; I, H: Integer; begin TIA := [12, 9, 1, 3, 79, 1]; H := High(TIA); for I := 0 to H do WriteLn(TIA[i]); I := 2; Inc(I); WriteLn(I); end. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted December 30, 2011 Author Share Posted December 30, 2011 (edited) I guess it would help to explain what im doing. Im using This function FindColorsTolerance var w, h: Integer; TPA: TPointArray; begin GetClientDimensions(w, h); if FindColorsTolerance(TPA, 4, 0, 0, w - 1, h - 1, 5) then begin WriteLn('Found color ' + IntToStr(Length(TPA)) + ' times'); WriteLn('Coordinates: ' + TPAToStr(TPA)); end; end. id like to use the function like this.. var TPA: TPointArray; Function FindSomething (Color : integer) : Boolean; var w, h: Integer; begin GetClientDimensions(w, h); if FindColorsTolerance(TPA, Color, 0, 0, w - 1, h - 1, 5) then results := true end; Then pull the information out of the TPA for mouse movements. make sense? or am i making it more difficult than it needs to be? Edited December 30, 2011 by shadowrecon Quote Link to comment Share on other sites More sharing options...