Results 1 to 4 of 4

Thread: Calculate Rate?

  1. #1
    Join Date
    May 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Calculate Rate?

    Is it possible to calculate rate? I have a variable named "totalinv" and I would like to calculate amount per hour, or amount per 15 minutes... Is this possible? I looked at some code examples like this (below)

    SCAR Code:
    Rate := 3600 * (totalinv) / Sec();

    However, this deals in extended variables and I'm not sure this is achieving the correct result.

    Does anyone know how to do this?

    Any help would be greatly appreciated. Thanks!

  2. #2
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by pianoman933 View Post
    Is it possible to calculate rate? I have a variable named "totalinv" and I would like to calculate amount per hour, or amount per 15 minutes... Is this possible? I looked at some code examples like this (below)

    SCAR Code:
    Rate := 3600 * (totalinv) / Sec();

    However, this deals in extended variables and I'm not sure this is achieving the correct result.

    Does anyone know how to do this?

    Any help would be greatly appreciated. Thanks!
    maybe something like this? Who knows I could be WAYYY off.
    SCAR Code:
    begin
    if ((TimeFromMark(Mark) / 1000 * 60) >= 60)then // starts every hour
    Rate := totalinv / (timerunning / 4) // hour divided by 4(equals 15 minutes)
    WriteLn(' Amount Per 15 Minutes: ' + IntToStr(Rate));
    end else
    Exit;

  3. #3
    Join Date
    Feb 2007
    Location
    Toronto, Ontario, Canada
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This should work...
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
      Start, Got, Rate : integer;
    begin
      MarkTime(Start);
      repeat
        //Do stuff
        Got := Got + 1;
      until((TimeFromMark(Start) * 1000)/60 = 15)
      //15 minutes, reasonable interval to extrapolate from
      Rate := Got * 4; //15 mins * 4
      Writeln(IntToStr(Rate));
    end.

  4. #4
    Join Date
    May 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the possibilities I'll get right on trying these out.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. calculate the values and draw chart
    By Laimonas171 in forum C#/Visual Basic Help and Tutorials
    Replies: 2
    Last Post: 12-26-2008, 09:12 AM
  2. Calculate combat
    By jhildy in forum Research & Development Lounge
    Replies: 8
    Last Post: 09-16-2007, 03:43 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
  •