Results 1 to 9 of 9

Thread: Reverse A List

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Reverse A List

    Hey,
    Not sure if this Forum is right.

    I'm searchig for a simple tool, that can reverse a List. I Need to reverse this List and remove Multiple entries... But if i just could reverse it, that would be awesome. I'm too lazy to do it manually. I basicly need the walking procedure backwards.. TO walk the way back...

    Code:
    Point(3188, 3698),
    Point(3188, 3698),
    Point(3188, 3698),
    Point(3186, 3691),
    Point(3188, 3684),
    Point(3190, 3676),
    Point(3190, 3668),
    Point(3197, 3668),
    Point(3199, 3674),
    Point(3201, 3682),
    Point(3200, 3687),
    Point(3200, 3694),
    Point(3200, 3699),
    Point(3200, 3706),
    Point(3200, 3708),
    Point(3200, 3715),
    Point(3200, 3718),
    Point(3198, 3721),
    Point(3200, 3728),
    Point(3199, 3738),
    Point(3199, 3740),
    Point(3199, 3747),
    Point(3194, 3754),
    Point(3193, 3760),
    Point(3190, 3764),
    Point(3190, 3773),
    Point(3187, 3773),
    Point(3182, 3776),
    Point(3177, 3779),
    Point(3168, 3781),
    Point(3162, 3784),
    Point(3159, 3789),
    Point(3157, 3795),
    Point(3157, 3799),
    Point(3152, 3804),
    Point(3152, 3810),
    Point(3152, 3817),
    Point(3151, 3823),
    Point(3150, 3831),
    Point(3148, 3839),
    Point(3141, 3839),
    Point(3135, 3840),
    Point(3135, 3845),
    Point(3131, 3851),
    Point(3128, 3856),
    Point(3125, 3862),
    Point(3125, 3870),
    Point(3123, 3875),
    Point(3119, 3879),
    Point(3112, 3885),
    Point(3105, 3885),
    Point(3099, 3887),
    Point(3092, 3886),
    Point(3085, 3886),
    Point(3080, 3883),
    Point(3074, 3885),
    Point(3074, 3885),
    Point(3067, 3884),
    Point(3061, 3885),
    Point(3060, 3885)

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  3. #3
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    To reverse it use InvertTPA.

    EDIT: Zasz, you beat me.
    lol

  4. #4
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Meh InvertTPA might be better, we got different methods
    I do visit every 2-6 months

  5. #5
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure Reverse(var Arr: TVariantArray);
    var
      i, MaxIndex, Half, c: Integer;
      t: Variant;
    begin
      MaxIndex := High(Arr);
      Half := Floor((1.0*MaxIndex)/2.0);
      for i:=0 to Half do
      begin
        c := MaxIndex-i;
        t := Arr[i];
        Arr[i] := Arr[c];
        Arr[c] := t;
      end;
    end;

    Goes half way down the list and swaps the i and Max-i values.
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

  6. #6
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    InvertTPA doesnt serve my needs XD. Because i got a function with a "case of" thingy +-+... and uhm yeah.. i just need to change some stuff.. thanks.. i think I'll get it to work.. yeah =)

    Thanks aLot =).

    ~caused


    Oh.. Zasz, that worked like a chaaarm =D.. thanks
    Last edited by caused; 06-20-2009 at 02:22 AM.

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    You trying to do opposite walking like WalkToMine = that now you want WalkToBank?
    Do... ARGH crap mind gone blank lemme go check it summin like
    Opposite(WalkToMine)

    T~M

  8. #8
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    I Used Zasz script now. and changed it a little =).
    THanks for the support, everyone.

    program New;

    var
    path : tpointarray;
    b,i:integer;

    const
    length_of_result = 3;

    function r_path:tpointarray;
    begin
    SetLength(Result, length_of_result);
    result:=[
    Point(3188, 3698),
    Point(3188, 3698),
    Point(3188, 3698),
    Point(3186, 3691),
    Point(3188, 3684),
    Point(3190, 3676),
    Point(3190, 3668),
    Point(3197, 3668),
    Point(3199, 3674),
    Point(3201, 3682),
    Point(3200, 3687),
    Point(3200, 3694),
    Point(3200, 3699),
    Point(3200, 3706),
    Point(3200, 3708),
    Point(3200, 3715),
    Point(3200, 3718),
    Point(3198, 3721),
    Point(3200, 3728),
    Point(3199, 3738),
    Point(3199, 3740),
    Point(3199, 3747),
    Point(3194, 3754),
    Point(3193, 3760),
    Point(3190, 3764),
    Point(3190, 3773),
    Point(3187, 3773),
    Point(3182, 3776),
    Point(3177, 3779),
    Point(3168, 3781),
    Point(3162, 3784),
    Point(3159, 3789),
    Point(3157, 3795),
    Point(3157, 3799),
    Point(3152, 3804),
    Point(3152, 3810),
    Point(3152, 3817),
    Point(3151, 3823),
    Point(3150, 3831),
    Point(3148, 3839),
    Point(3141, 3839),
    Point(3135, 3840),
    Point(3135, 3845),
    Point(3131, 3851),
    Point(3128, 3856),
    Point(3125, 3862),
    Point(3125, 3870),
    Point(3123, 3875),
    Point(3119, 3879),
    Point(3112, 3885),
    Point(3105, 3885),
    Point(3099, 3887),
    Point(3092, 3886),
    Point(3085, 3886),
    Point(3080, 3883),
    Point(3074, 3885),
    Point(3074, 3885),
    Point(3067, 3884),
    Point(3061, 3885),
    Point(3060, 3885)
    ];
    end;

    begin
    cleardebug;
    path := r_path;
    b := high(path);
    writeln('SetLength(Result, '+inttostr(b+1)+');');
    b := 0;
    for i := High(Path) downto 0 do
    begin
    b := b + 2;
    WriteLn('Point(' + IntToStr(Path[i].X) + ', ' + IntToStr(Path[i].Y) + '),');
    end;
    end.

  9. #9
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Glad I could Help
    I do visit every 2-6 months

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •