Results 1 to 4 of 4

Thread: Current Time

  1. #1
    Join Date
    Apr 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Current Time

    I need help writing out the current time. Here is my script.

    CURRENT TIME ON MY COMPUTER: 3:35 & 30 seconds
    or military time: 15:34:30


    SCAR Code:
    program NameMe;
    //{.Include SRL\SRL.scar}

    var
      BeginTime: Cardinal;
      Varriable: Integer;

    const
      Constant = 0;
      ScarName = 'Document1 - Microsoft Word';

    procedure pCurrentTime;
    var
      h,m,s: Integer;
    begin
      // IF RUN SCRIPT FOR MORE THAN # /1000 SECONDS... THEN
      if (GetSystemTime-BeginTime>6000) then
        begin
          WriteLn('--------------------------------------------------');
          WriteLn('SECONDS  Elapsed:   '+FloatToStr((GetSystemTime-BeginTime)/1000));
          WriteLn('MINUTES  Elapsed:   '+FloatToStr((GetSystemTime-BeginTime)/60000));
          WriteLn('HOURS    Elapsed:   '+FloatToStr((GetSystemTime-BeginTime)/3600000));
        end;
      // I HAVE NO IDEA WHY THIS MUST BE SUBTRACTED
      ConvertTime((GetSystemTime-(2547046+43200000+86400000+86400000)),h,m,s);
      WriteLn('Current Time: '+FloatToStr(h)+':'+FloatToStr(m)+':'+FloatToStr(s));
    end;

    begin
      BeginTime:=GetSystemTime;
      Disguise(ScarName);
      ClearDebug;
      pCurrentTime;
      //OTHER STUFF
    end.

    REPORT-BOX:

    Current Time: 15:34:30
    Successfully executed



    If I merely use the following line...
    SCAR Code:
    ConvertTime(GetSystemTime,h,m,s);
    WriteLn('Current Time: '+FloatToStr(h)+':'+FloatToStr(m)+':'+FloatToStr(s));

    I receive this:

    REPORT-BOX:

    Current Time: 76:16:57
    Successfully executed


    Please help me understand this... I keep having to add a new "86400000" everyday.
    JavaIRC: SuperMan

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    From my Caver:
    SCAR Code:
    WriteLn('It was '+(TheTime)+' on '+(TheDate(1))+' when this proggy was written:');

    Is that what you need?


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Apr 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    From my Caver:
    SCAR Code:
    WriteLn('It was '+(TheTime)+' on '+(TheDate(1))+' when this proggy was written:');

    Is that what you need?
    Line 85: [Error] (85:20): Unknown identifier 'TheTime' in script
    What do I include?
    JavaIRC: SuperMan

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    {.Include SRL/SRL.scar} of cource

    You can even go to SRL/Core/Time.scar and look at the procedures there.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 67
    Last Post: 03-25-2009, 10:32 AM
  2. Long time listener...first time caller
    By Ransom in forum Who Are You ? Who ? Who ?
    Replies: 0
    Last Post: 11-04-2006, 02:05 AM

Posting Permissions

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