I am having a peculiar problem with the update of the Tsay object. I am passing a SAY object as parameter to different functions. The say object is supposed to show the status of my different routines on a MDI Child Window.
I tried
- Code: Select all Expand view RUN
- oSay:SetText("New Value of the Satus") // Doesn't work
oSay:Refresh() // Doesn't work
oSay:VarPut(("New Value of the Satus") // This works along with oSay:Refresh()
oSay:Refresh() // This does the work
I thought of pasting a sample here to demonstrate the problem and created one, but to my surprise the problem exists only in my real app. The sample app which I created to imitate the problem is working fine.
Anyway oSay:VarPut() + oSay:Refresh() is serving my purpose. For my knowledge/learning purpose, I would like to know why is it behaving so.
Anybody here experienced similar problem with SAY object ?
Application is on MDI Environment, I create the local SAY object on a MDI Child Window and then pass the oSay as parameter to few other functions which updates the text on the SAY object.
For Eg.
- Code: Select all Expand view RUN
- Local oWnd,oSay,oBtn
DEFINE WINDOW oWnd MDICHILD OF WndMain()
@1,1 say oSay OF oWnd SIZE 200,15
@2,10 BUTTON oBtn OF oWnd SIZE 90,40 ;
ACTION ( MyRoutine_1(oSay), ;
MyRoutine_2(oSay) )
ACTIVATE WINDOW oWnd
Return NIL
//------------------------------------------------
Function MyRoutine_1(oSay)
oSay:SetText:="Started Process 1"
Do While ...
Enddo
oSay:SetText:="Finished Process 1"
Return
//------------------------------------------------
Function MyRoutine_2(oSay)
oSay:SetText:="Started Process 2"
Do While ...
Enddo
oSay:SetText:="Finished Process 2"
Return
....
Any hint ?
Regards
Anser