Results 1 to 12 of 12

Thread: Checking Markt

  1. #1
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default Checking Markt

    Is there anyway to check the time that has passed from when you call MarkTime?
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  2. #2
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

  3. #3
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Silly! I know that haha, but I'm looking for a timer....hope I can explains this so it makes sense.


    Okay.

    Simba Code:
    MarkTime(Timer);
    //Blah blah blah
    //more stuff etc
    //Want to check the time that has passed up until this point and post it in the debug box

    Does that make sense? I just want to mark the time and after it does whatever procedures/functions I want to see how much time has passed since I marked the time.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  4. #4
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Like he said..

    Simba Code:
    MarkTime(C);
    Do...
    This..
    Stuff..
    WriteLn(TimeFromMark(C));

    ~Home

  5. #5
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    ^^^ Wouldn't you have to do IntToStr() ?

  6. #6
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    ^^^ Wouldn't you have to do IntToStr() ?
    Nope Only when you're mixing strings with integers(/variants).

  7. #7
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Nope Only when you're mixing strings with integers(/variants).
    But isn't TimeFromMark(C) an integer and doesn't Writeln() require a string?

    Is that not mixing?

  8. #8
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    But isn't TimeFromMark(C) an integer and doesn't Writeln() require a string?

    Is that not mixing?
    Mixing:
    Writeln('Time: '+TimeFromMark(t));

    Writeln actually doesn't require a string, only when more than 1 type of variable is being used. As long as you ask it to write a single variable, it will accept any variant.

  9. #9
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Mixing:
    Writeln('Time: '+TimeFromMark(t));

    Writeln actually doesn't require a string, only when more than 1 type of variable is being used. As long as you ask it to write a single variable, it will accept any variant.
    Ah, alright. I get it now

    See I usually do Writeln('Time: '+TimeFromMark(t));, which explains a lot.

  10. #10
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Ahh thank you Runaway..you seem to always be helping me haha. Also thanks Home. For some reason I thought it would of been more difficult.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  11. #11
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    I use this function which I slightly modified from a code that runaway posted when I asked a similar question a little while back -
    Simba Code:
    procedure TimeStamp(WaitTime: Integer);
    var
      T: Integer;
      Ticker: String;
    begin
      MarkTime(T);
      while (WaitTime > TimeFromMark(T)) do
      begin
        Wait(500);
        Ticker := MsToTime(WaitTime - TimeFromMark(T), Time_Short);
        Status('Break remaining: ' + Ticker);
      end;
    end;

    used like this in my script
    Simba Code:
    BreakLength := RandomRange(30000,1200000);//how long the break is
        WriteLn('Taking a break for ' + (MsToTime(BreakLength, Time_Short)));
        MarkTime(BreakT);//my time mark for the break so to speak
        TimeStamp(BreakLength);//Write TimeStamp with the time to countdown in the brackets
        repeat
          Wait(100);
        until (BreakLength < TimeFromMark(BreakT));

    Feel free to edit this as you wish to suit your purposes if you'd like, it just writes the time remaining in your status bar

  12. #12
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Thanks mate!
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

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
  •