Sys_Time still Unaccessable?
Posted: Mon Sep 07, 2009 2:41 am
Is the system time accessable in algodoo? If yes, how?
Blazemann wrote:Is the system time accessable in algodoo? If yes, how?
#include <Windows.h>
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
void UpdateLoop ();
int main(int argc, char *argv[])
{
int x = 7;
int y = 8;
cout << "Beginning time upadate loop now..." << endl;
for (x = 9; x> y; x++)
UpdateLoop();
cout << "Passed time update loop, there has been a problem in execution";
system("PAUSE");
return EXIT_SUCCESS;
}
void UpdateLoop()
{
ofstream LocalTime;
LocalTime.open("communication.cfg",ios::trunc|ios::out);
SYSTEMTIME st;
GetSystemTime(&st);
LocalTime << "Scene.my.Year = " << st.wYear << ";\nScene.my.Month = " << st.wMonth << ";\nScene.my.Day = " << st.wDay << ";\nScene.my.Hour = " << st.wHour << ";\nScene.my.Min = " << st.wMinute << ";\nScene.my.Second = " << st.wSecond << ";\n";
LocalTime.close();
Sleep(100);
}