Results 1 to 4 of 4

Thread: I cant figure this out.

  1. #1
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Exclamation I cant figure this out.

    Im working on a timer for a progress report and i cant get it to add to mins.
    here is my progress report code.

    Simba Code:
    procedure proggy;
    var
    hr,mins,time,time1:integer;
    begin
      time:=getsystemtime - starttme
      time1:=time/1000
        if mins = 60 then
          begin
            mins:= 0
            hr:= hr +1
          end;
        if time1 = 60 then
          begin
            starttme:= getsystemtime
            mins:= mins +1
            time1:= 0
          end;


    cleardebug;
    writeln('-------------------------------------------------------------------------------------------------------------------------------------------------------');
    writeln('|Estimated total xp = '+ inttostr(xptotal)+' xp.         | Total estimated cash gain = '+inttostr(cshgain)+' g.|');
    writeln('|Estimated total class xp = '+ inttostr(clstotal)+' xp.|');
    writeln('|Total fights = '+inttostr(ftstotal)+'.|');
    writeln('|Currently: '+gmstatus+'.|');
    writeln('|Time running = '+inttostr(hr)+' hours, '+inttostr(mins)+' minutes, '+inttostr(time1)+' seconds.|');
    writeln('|AdventureQuestWorlds fighter beta by austin2162                                                                                                      |');
    writeln('-------------------------------------------------------------------------------------------------------------------------------------------------------');
    end;

    here is the issue though
    hers the print out.
    as you see one minute is added
    Simba Code:
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    |Estimated total xp = 0 xp.         | Total estimated cash gain = 0 g.|
    |Estimated total class xp = 0 xp.|
    |Total fights = 0.|
    |Currently: Debuging.|
    |Time running = 0 hours, 1 minutes, 0 seconds.|
    |AdventureQuestWorlds fighter beta by austin2162                                                                                                      |
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    this is the next report
    Simba Code:
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    |Estimated total xp = 0 xp.         | Total estimated cash gain = 0 g.|
    |Estimated total class xp = 0 xp.|
    |Total fights = 0.|
    |Currently: Debuging.|
    |Time running = 0 hours, 0 minutes, 1 seconds.|
    |AdventureQuestWorlds fighter beta by austin2162                                                                                                      |
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    any help?
    edit: Im using simba
    Last edited by austin2162; 05-11-2011 at 10:44 PM.
    ~Austin~

  2. #2
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Instead of doing it manually, you could use the function MsToTime(MS, TheType: Integer): string;

    like this: writeln('|Time running = ' + MsToTime(GetSystemTime - StartTime, Time_Formal) + '. |');

    Would output (Example) "|Time running = 5 hours, 23 minutes and 26 seconds. |"

  3. #3
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Zyt3x. Also thanks on the quick response.
    ~Austin~

  4. #4
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    You could try MsToTime(time, Time_Abbrev) to do the conversion/formatting for you. Outputs a string that looks something like this:

    5 hr 13 min 2 sec
    Edit: Damn, took too long to type/post.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

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
  •