- Code: Select all Expand view
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oSay
LOCAL n := 0
DEFINE DIALOG oDlg
@ 1, 1 SAY oSay PROMPT "Counter: " + LTRIM( STR( n ) );
SIZE 200, 15
@ 2, 1 BUTTON "Start";
ACTION COUNTER( oSay, @n )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
STATIC FUNCTION COUNTER( oSay, n )
LOCAL i
FOR i = 1 TO 100
n++
oSay:Refresh()
SYSWAIT( 0.01 )
NEXT
TONE( 400, 1 )
RETURN NIL
It should count from 1 to 100 when the button is pressed. Instead the label shows 1 and is not refreshed anymore.
The cause seems to be the statement
- Code: Select all Expand view
::VarPut( ::cCaption )
added in the latest TSay class.
EMG