Jump to content
LordJashin

OSI Tons of new functions thx to MSSL

Recommended Posts

Thanks Jani! Now there is loads of array functions in OSI. They might need to be ordered, and some thrown out or added but for now they look pretty good! Like some had DeleteEx, and others didn't. Same with having Copy or other things.

 

Anyway here's the giant change log for past 2 days:

 


-------------------------
LordJashin - 10/25/2012 :
-------------------------

Added:

File:
  - Divi/Boolean.scar:
                    - function StrIsBool(s: string): Boolean;
                    - function TBoAPos(bool: Boolean; arr: TBoolArray): Integer;
                    - function TBoALastPos(bool: Boolean; arr: TBoolArray): Integer;
                    - function TBoAPositions(bool: Boolean; arr: TBoolArray): TIntArray;

  - Divi/StringArray.scar:                     
                    - function  TSAToStr(arr: TStrArray): string;
                    - function  TSAConcat(arr: TStrArray): string;
                    - procedure TSAReverse(var arr: TStrArray);
                    - function  TSARandomize(arr: TStrArray): TStrArray;     
                    - procedure TSATrim(arr: TStrArray; delEmpty: Boolean);                      
                    - function  TSAOfString(x: string; count: Integer): TStrArray;
                    - procedure TSASetItems(var arr: TStrArray; x: string);
                    - procedure TSASetItemsEx(var arr: TStrArray; x: string; exceptions: TIntArray);
                    - procedure TSARemoveNulls(var arr: TStrArray);
                    - procedure TSARemoveEmptyItems(var arr: TStrArray);
                    - function  TSAPos(arr: TStrArray; s: string): Integer;
                    - function  TSAPosAll(arr: TStrArray; s: string): TIntArray;
                    - function  TSAAllSame(arr: TStrArray): Boolean;
                    - function  TSAAllUnique(arr: TStrArray): Boolean;
                    - function  TSAAllBetween(s1, s2: string; arr: TStrArray): TStrArray;
                    - function  TSAItemsByTIA(arr: TStrArray; x: TIntArray): TStrArray;

Divi/Array.scar:
             - procedure TSAInsert(var arr: TStrArray; index: Integer; s: string);
             - procedure TSAUnique(var arr: TStrArray);
             - function  TSASame(arr1, arr2: TStrArray): Boolean;
             - function  TSAContains(arr: TStrArray; x: string): Boolean;
             - function  TSADelete(var arr: TStrArray; x: Integer): Boolean;
             - procedure TSADeleteEx(var arr: TStrArray; x: TIntArray);
             - procedure TSAAppend(var arr: TStrArray; x: string);                            
             - procedure TSACopy(source: TStrArray; var target: TStrArray; resetTarget: Boolean);
             - function  TSACopyEx(arr: TStrArray; pos1, pos2: Integer): TStrArray;
             - procedure TBoAInsert(var arr: TBoolArray; index: Integer; bool: Boolean);
             - function  TBoAContains(arr: TBoolArray; x: Boolean): Boolean;
             - function  TBoADelete(var arr: TBoolArray; x: Integer): Boolean;
             - procedure TBoAAppend(var arr: TBoolArray; x: Boolean);
             - procedure TBoACopy(source: TBoolArray; var target: TBoolArray; resetTarget: Boolean);
             - function  TBoACopyEx(arr: TBoolArray; pos1, pos2: Integer): TBoolArray; 

Divi/Box.scar:
           - procedure TBASkipBoxesByArea(var TBA: TBoxArray; skipArea: TBox; fromInside: Boolean);
           - procedure TBASkipBoxesByAreas(var TBA: TBoxArray; skipAreas: TBoxArray; fromInside: Boolean);

Improvements:

Renamed:
     - (BoxInBox  -> BoxContains)
     - (CheckTBoA -> TBoATrueAmount)

Moved:
   - TBoATrueAmmount (Divi/Array.scar -> Divi/Boolean.scar)
   - StrSplitEx      (Divi/String.scar -> Divi/StringArray.scar)
   - InStrArrPos     (Divi/String.scar -> Divi/StringArray.scar)
   - StrContainsEx   (Divi/String.scar -> Divi/StringArray.scar)
   - StrExplodeMulti (Divi/String.scar -> Divi/StringArray.scar)
   - TBAContains     (Divi/Box.scar -> Divi/Array.scar)
   - TBASame         (Divi/Box.scar -> Divi/Array.scar)
   - TBACopyEx       (Divi/Box.scar -> Divi/Array.scar)

Updated all comment headers in files to make them look better

Thanks to MSSL for more awesome functions!

-------------------------
LordJashin - 10/24/2012 :
-------------------------

Added:

Divi/Globals.scar:
   - type T3DPoint & type T3DPointArray

Divi/String.scar:
   - function StrIndentation(s: string; count: Integer): string;
   - function StrStartWith(suffix: string; var s: string): Boolean;
   - function StrEndWith(suffix: string; var s: string): Boolean;

Improvements:

Moved:
   - TBAInsert (Divi/Box.scar -> Divi/Array.scar)
   - TBAUnique (Divi/Box.scar -> Divi/Array.scar)
   - TBADelete (Divi/Box.scar -> Divi/Array.scar)

Link to comment
Share on other sites

Updated with TEA, Variant, and more functions. Added Variant.scar:

 

-------------------------
LordJashin - 10/26/2012 :
-------------------------

Added:

File:
  - Divi/Variant.scar:
                    - function TVAGetItems(arr: TVariantArray; IDs: TIntArray): TVariantArray;
                    - function TVAToParts(arr: TVariantArray; method: (pm_PartSize, pm_PartAmount); x: Integer): array of TVariantArray;
                    - function TVAAllValuesSame(valueArr: TVariantArray): Boolean;
                    - function TVAAllValuesUnique(arr: TVariantArray): Boolean;

Divi/Array.scar:
             - procedure TVAInsert(var arr: TVariantArray; index: Integer; item: Variant);
             - procedure TVAAppend(var arr: TVariantArray; x: Variant);
             - function  TVADelete(var arr: TVariantArray; x: Integer): Boolean;
             - procedure TVACopy(source: TVariantArray; var target: TVariantArray; resetTarget: Boolean);
             - function  TVACopyEx(arr: TVariantArray; pos1, pos2: Integer): TVariantArray;
             - procedure TEAInsert(var arr: TExtArray; index: Integer; float: Extended);
             - procedure TEAUnique(var arr: TExtArray);
             - function  TEASame(arr1, arr2: TExtArray): Boolean;
             - function  TEAContains(arr: TExtArray; x: Extended): Boolean;
             - procedure TEACopy(source: TExtArray; var target: TExtArray; resetTarget: Boolean);
             - function  TEACopyEx(arr: TExtArray; pos1, pos2: Integer): TExtArray;
             - procedure TEAAppend(x: Extended; var arr: TExtArray);
             - function  TEADelete(var arr: TExtArray; x: Integer): Boolean;

Divi/Extended.scar:
                - function  TEASum(x: TExtArray): Extended;
                - procedure TEAReverse(var arr: TExtArray);
                - function  TEAPos(arr: TExtArray; ext: Extended): Integer;
                - function  TEAPositions(arr: TExtArray; ext: Extended): TIntArray;
                - function  TEAGetItems(arr: TExtArray; IDs: TIntArray): TExtArray;
                - function  TEAAllValuesSame(arr: TExtArray): Boolean;
                - function  TEAAllValuesUnique(arr: TExtArray): Boolean;
                - function  ATEAGetItems(arr: T2DExtArray; TIA: TIntArray): T2DExtArray;

Divi/Math.scar:
            - function RandomBool: Boolean;

Divi/String.scar:
              - function StrStartWithEx(suffix: string; var s: string; offset: Integer): Boolean;
              - function StrEndWithEx(suffix: string; var s: string; offset: Integer): Boolean;

Divi/StringArray.scar:
                   - procedure ATSACopy(source: T2DStrArray; var target: T2DStrArray; resetTarget: Boolean);
                   - function  ATSAMerge(arr: T2DStrArray): TStrArray;
                   - function  ATSAItemsByTIA(arr: T2DStrArray; TIA: TIntArray): T2DStrArray;
                   - function  ATSAOfTSA(x: TStrArray; amount: Integer): T2DStrArray;

 

As for the future of all this array madness! I will be condensing a lot of it and organizing it. A lot of these functions do the same things over and over too, so I'm thinking about making some functions so it doesn't fluff up the files as much.

Link to comment
Share on other sites

Yeah LJ and Jani are competing in a contest of who can commit more a week for the past 2 week xD:P. More or less at least I finally got the guts to make a change log -_-...

 

 

Also, I am going to sort a lot of the new stuff that I added recently. Like all the Array functions and such. I'm considering making more folders in OSI too, or different "levels" of includes? ...

Edited by LordJashin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...