Results 1 to 4 of 4

Thread: repeat until

  1. #1
    Join Date
    Nov 2011
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default repeat until

    this is my main loop

    Code:
    begin
     SetUpSrl;
     repeat
       kick;
     until(300);
     end.
    however it doesnt work, i know if i put true/false in the until line then it would work, but how do i make it repeat itself until a certain amount of time?

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Try this:
    Simba Code:
    procedure Example;
    var
      T : Integer;
    begin
      MarkTime(T);

      while (TimeFromMark(T) < 1500) do
      begin
        Wait(100);
      end;

      WriteLn(ToStr(T));
    end;
    Last edited by RISK; 12-11-2011 at 05:54 AM. Reason: Corrected the "Write" line to be proper for this example.

  3. #3
    Join Date
    Nov 2011
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    mind explaing what each code does?

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Here:
    Simba Code:
    procedure Example;
    var
      T : Integer; // Makes "T" an integer
    begin
      MarkTime(T); // Uses the integer "T" to mark the time that has passed in milliseconds

      while (TimeFromMark(T) < 1500) do // While the value (The time) of integer "T"
      begin                                          // is less than "1500", do this:
        Wait(100); // Waits 100 milliseconds
      end;

      WriteLn(ToStr(T)); // Writes the value of "T"
    end;

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
  •