Results 1 to 4 of 4

Thread: How to add to arrays

  1. #1
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to add to arrays

    Short and hopefuly simple

    How do i added to an array on the run
    For example

    Array := [a,b,d,e]

    and i want to add c, so how can i do that?

    THanks for your time and help

    E: takes and secound question

    would this work?

    Simba Code:
    Array := [a,b,c,d]
    Array := Array - Array[2]
    To take the B out?

    Thanks again
    Last edited by Troll; 02-14-2011 at 03:58 PM.
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  2. #2
    Join Date
    Dec 2010
    Posts
    808
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Array := Array + c;

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    Var X, Y, I, C : Integer;
      Arr : TStringArray;

    Begin
      Arr := [];
      Repeat
        Inc(C);
        SetLength(Arr, C + 1);
        Arr[C] := 'lol'+IntToStr(c);
      Until(C = 100);
      WriteLn(Arr[8]);
    End.

    Should explain it for you
    Last edited by Naum; 02-13-2011 at 06:19 PM.

  4. #4
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Really? That simple thanks thats great
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

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
  •