by dollyknot » Sun Dec 05, 2010 11:27 am
Dim PonderCode as String
rem PonderCode = ("-ponder")
Private Sub Start_OnEvent()
PonderCode = ("-xponder")
End Sub
Private Sub CommandButton2_OnEvent()
Label1.caption = "Start"
Dim ReturnCode as Integer
Dim TimeCode as String
TimeCode = Inputbox ("Time limit ")
? TimeCode
ReturnCode = shell("/usr/games/xboard -fcp crafty -tc " & TimeCode & Pondercode & " -scp crafty", FALSE)
End Sub
It works ok, but one would have thought the code would have been the hard bit and the gui the easy bit, but I can't seem to get my head around it.
Like I have my form with two buttons on it, I click one button and it turns ponder mode off, the default being 'ponder' on, so crafty calculates what I might do, whilst I analyse the position.
I click the other button and it lets me select how much time crafty will spend on the game.
I looked at some of the code examples and thought that 'Label1.caption = "Start"' would label the button that selects the time and fires up xboard with crafty as its engine. Everything works ok and it does not complain about 'Label1.caption = "Start"' but the button remains with the caption 'Commandbutton' Perhaps the caption is set on the form somehow?