I wonder if it's the debugger which is giving the odd results,
i tried this simple prog running from pb and watching the debugger output..
Code: Select all
Global variable.l
Procedure addme()
Repeat
variable+1
;Debug "Addme Working"
Delay(10)
ForEver
EndProcedure
Procedure subme()
Repeat
variable-1
;Debug "Subme Working"
Delay(10)
ForEver
EndProcedure
CreateThread(@addme(),0)
CreateThread(@subme(),0)
Repeat
Debug variable
Delay(1)
ForEver
Then i tried this code, which seems just as bad (as you would expect)
Code: Select all
Enumeration
#Window_0
EndEnumeration
Enumeration
#String_0
EndEnumeration
Global variable.l
Procedure addme()
Repeat
variable+1
;Debug "Addme Working"
Delay(10)
ForEver
EndProcedure
Procedure subme()
Repeat
variable-1
;Debug "Subme Working"
Delay(10)
ForEver
EndProcedure
CreateThread(@addme(),0)
CreateThread(@subme(),0)
; Repeat
; Debug variable
; Delay(1)
; ForEver
If OpenWindow(#Window_0, 558, 298, 177, 121, #PB_Window_SystemMenu | #PB_Window_TitleBar , "New window ( 0 )")
If CreateGadgetList(WindowID())
StringGadget(#String_0, 26, 29, 132, 27, "")
EndIf
EndIf
Repeat
Event = WaitWindowEvent()
SetGadgetText(#String_0,Str(variable))
Delay(10)
Until Event = #PB_EventCloseWindow
End
However when compiled and run as an .exe it does seem to be more stable.
I looked up 'paranoid' in the dictionary this morning.
It said, 'what do you want to know that for?'