SimApi Timer getPosition 1

From SIMboxWiki
Jump to navigation Jump to search


Icon attributes.pngstatic int SimApi::Timer::getPosition(const _SYSTEMTIME &i_Time)

    Description

    Gets for a specified time value corresponding session position in persantage of a total session duration

    Parameters

    i_Time - - time within the session, for which the position should be calculated

    Return

    Type: int   Description: Session position in persantage of a total session duration

    Remarks
    

Get for a specified time value corresponding session position in persantage of a total session duration. The time should be between session start and end time and provided in standard SYSTEMTIME structure of Win32 API. For details about SYSTEMTIME structure see its information in MSDN. Returned value should be within 0-100 range.


    Code Sample 

SYSTEMTIME st; 
// Set time to Thursday, 3 Dec 2009, 10:45:00:000 
 st.wYear = 2009; 
 st.wMonth = 12; 
// December 
 st.wDayOfWeek = 4; 
// Thursday 
 st.wDay = 3; 
 st.wHour = 10; 
// 10 AM 
 st.wMinute = 45; 
 st.wSecond = 0; 
 st.wMilliseconds = 0; 
// Get corresponding session position 
 int nSessionPositionInPercents = SimApi Timer getPosition(st);



    Related Links

    SimApi Timer getCurrentPosition