Results 1 to 5 of 5

Thread: Variable Problems

  1. #1
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    1,610
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Variable Problems

    Ok i got a problem. I want a variable that at the beginning of the script equals "0" then after every loop "1" is added to it (so by the 3rd loop the variable will equal 3) this is the script i have doing it. the variable name is TimeRound. Waht am i doing wrong? Any help would be appreciated.



    SCAR Code:
    procedure WhatTimeRound;
    begin
      Timeround = 0;
    end;




    SCAR Code:
    Procedure AddTimeRound;
    begin
      Timeround + 1;
    end;

  2. #2
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    Timeround:=0;
    repeat
      DoStuff;
      Timeround:=Timeround+1;
    until (Timeround=3);
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  3. #3
    Join Date
    Feb 2006
    Location
    Myrtle Beach, SC USA!
    Posts
    841
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Cheesehunk
    SCAR Code:
    Timeround:=0;
    repeat
      DoStuff;
      Timeround:=Timeround+1;
    until (Timeround=3);
    why not do it this way

    SCAR Code:
    for TimeRound := 1 to 3 do
     begin
      DoThisStuff;
      end;

  4. #4
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    1,610
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Cheesehunk and Dankness. Script Works now =P.

  5. #5
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Dankness
    why not do it this way

    SCAR Code:
    for TimeRound := 1 to 3 do
     begin
      DoThisStuff;
      end;
    Or this way?

    SCAR Code:
    while (not TimeRound=3) do
    begin
      DoStuff;
      TimeRound:=TimeRound+1;
    end;

    I always forget about for..to..do statements. Dankness's way is way more efficent, use that.
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is there any variable like...?
    By dritar in forum OSR Help
    Replies: 2
    Last Post: 10-05-2007, 06:07 PM
  2. Variable Problems
    By Ruroken in forum News and General
    Replies: 0
    Last Post: 09-07-2006, 09:05 PM

Posting Permissions

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