OpenWindowedScreen and double addition
Posted: Sat Jan 15, 2011 1:44 am
Hi,
Either it's too late
or there's something strange going on in this piece of code:
For some reason x1 is not equal to xx1, although it should be. It seems to be related to OpenWindowedScreen, because if you put the calculations all in front of the call the results are correct. Any ideas?
Either it's too late

Code: Select all
t.d = 0
x1.d = t + ParseDate("%yyyy/%mm/%dd %hh:%ii:%ss", "2021/01/01 17:02:01")
x2.d = ParseDate("%yyyy/%mm/%dd %hh:%ii:%ss", "2021/01/01 17:02:02")
x3.s = FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", x1)
x4.s = FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", x2)
InitKeyboard()
InitSprite()
OpenWindow(0, 0, 0, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 300, 200, 0, 0, 0)
u.d = 0
xx1.d = u + ParseDate("%yyyy/%mm/%dd %hh:%ii:%ss", "2021/01/01 17:02:01")
xx2.d = ParseDate("%yyyy/%mm/%dd %hh:%ii:%ss", "2021/01/01 17:02:02")
xx3.s = FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", xx1)
xx4.s = FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", xx2)
Repeat
ExamineKeyboard()
Until KeyboardReleased(#PB_Key_Escape)