Skip to main content

Hello i am Giorgos,

I have a problem with threads. Within my program1 i am doing some process and i would like in the meantime to show a window with "please waiting" message so the user to know that must wait. 

So i am doing a call "cancel" and the program1 calls the program2 that has the waiting window but there it is stays with no respond. what i am doing wrong?


program1:

*
GRAPH-PRESSED-DO-IT.
evaluate true
when GRAPH-Pressed| Search-Pressed| search-button-pushed
move zero to thread-return
set done to false
CALL thread "Cancel",
handle cancel-thread
returning into thread-return
end-CALL
perform search-thru-records
end-evaluate. 
.

*
search-thru-records.
perform until done
if (thread-return = 99)
set done to true
stop thread cancel-thread
else
PERFORM GRAPH-Ev-Cmd-Clicked
* set done to true
* stop thread cancel-thread
end-if
end-perform
.

program2:
*
Cancel-Screen1-Ev-Cmd-Activate.
* perform until cancel-button-hit
* display Cancel-Screen1
* end-perform.
close window Cancel-Screen1-Handle.
destroy Cancel-Screen1.
goback returning 99. 
.


#threads

Hello i am Giorgos,

I have a problem with threads. Within my program1 i am doing some process and i would like in the meantime to show a window with "please waiting" message so the user to know that must wait. 

So i am doing a call "cancel" and the program1 calls the program2 that has the waiting window but there it is stays with no respond. what i am doing wrong?


program1:

*
GRAPH-PRESSED-DO-IT.
evaluate true
when GRAPH-Pressed| Search-Pressed| search-button-pushed
move zero to thread-return
set done to false
CALL thread "Cancel",
handle cancel-thread
returning into thread-return
end-CALL
perform search-thru-records
end-evaluate. 
.

*
search-thru-records.
perform until done
if (thread-return = 99)
set done to true
stop thread cancel-thread
else
PERFORM GRAPH-Ev-Cmd-Clicked
* set done to true
* stop thread cancel-thread
end-if
end-perform
.

program2:
*
Cancel-Screen1-Ev-Cmd-Activate.
* perform until cancel-button-hit
* display Cancel-Screen1
* end-perform.
close window Cancel-Screen1-Handle.
destroy Cancel-Screen1.
goback returning 99. 
.


#threads

Hi Giogos,

not a thread expert myself I'm missing an ACCEPT in your program2.

What do you think ?


Hello i am Giorgos,

I have a problem with threads. Within my program1 i am doing some process and i would like in the meantime to show a window with "please waiting" message so the user to know that must wait. 

So i am doing a call "cancel" and the program1 calls the program2 that has the waiting window but there it is stays with no respond. what i am doing wrong?


program1:

*
GRAPH-PRESSED-DO-IT.
evaluate true
when GRAPH-Pressed| Search-Pressed| search-button-pushed
move zero to thread-return
set done to false
CALL thread "Cancel",
handle cancel-thread
returning into thread-return
end-CALL
perform search-thru-records
end-evaluate. 
.

*
search-thru-records.
perform until done
if (thread-return = 99)
set done to true
stop thread cancel-thread
else
PERFORM GRAPH-Ev-Cmd-Clicked
* set done to true
* stop thread cancel-thread
end-if
end-perform
.

program2:
*
Cancel-Screen1-Ev-Cmd-Activate.
* perform until cancel-button-hit
* display Cancel-Screen1
* end-perform.
close window Cancel-Screen1-Handle.
destroy Cancel-Screen1.
goback returning 99. 
.


#threads

Yes sorry, the part which is the display Cancel-Screen1 suppose to be accept. But when is accept my program hangs


Hello i am Giorgos,

I have a problem with threads. Within my program1 i am doing some process and i would like in the meantime to show a window with "please waiting" message so the user to know that must wait. 

So i am doing a call "cancel" and the program1 calls the program2 that has the waiting window but there it is stays with no respond. what i am doing wrong?


program1:

*
GRAPH-PRESSED-DO-IT.
evaluate true
when GRAPH-Pressed| Search-Pressed| search-button-pushed
move zero to thread-return
set done to false
CALL thread "Cancel",
handle cancel-thread
returning into thread-return
end-CALL
perform search-thru-records
end-evaluate. 
.

*
search-thru-records.
perform until done
if (thread-return = 99)
set done to true
stop thread cancel-thread
else
PERFORM GRAPH-Ev-Cmd-Clicked
* set done to true
* stop thread cancel-thread
end-if
end-perform
.

program2:
*
Cancel-Screen1-Ev-Cmd-Activate.
* perform until cancel-button-hit
* display Cancel-Screen1
* end-perform.
close window Cancel-Screen1-Handle.
destroy Cancel-Screen1.
goback returning 99. 
.


#threads

Try the accept in program2. Just for experiments try an accept that has a before time on it

accept cancel-screen before time 500

now see if you get a return back to program 1. If not, something else is going on and you'll need to post more code.


Hello i am Giorgos,

I have a problem with threads. Within my program1 i am doing some process and i would like in the meantime to show a window with "please waiting" message so the user to know that must wait. 

So i am doing a call "cancel" and the program1 calls the program2 that has the waiting window but there it is stays with no respond. what i am doing wrong?


program1:

*
GRAPH-PRESSED-DO-IT.
evaluate true
when GRAPH-Pressed| Search-Pressed| search-button-pushed
move zero to thread-return
set done to false
CALL thread "Cancel",
handle cancel-thread
returning into thread-return
end-CALL
perform search-thru-records
end-evaluate. 
.

*
search-thru-records.
perform until done
if (thread-return = 99)
set done to true
stop thread cancel-thread
else
PERFORM GRAPH-Ev-Cmd-Clicked
* set done to true
* stop thread cancel-thread
end-if
end-perform
.

program2:
*
Cancel-Screen1-Ev-Cmd-Activate.
* perform until cancel-button-hit
* display Cancel-Screen1
* end-perform.
close window Cancel-Screen1-Handle.
destroy Cancel-Screen1.
goback returning 99. 
.


#threads

One other question .. is GRAPH-PRESSED-DO-IT the action of an event or the action of an exception procedure? If an event, you're still sitting on the original accpt .. if an exception procedure, then your accept has ended and the Program1 is waiting for what to do next .. display screen-2 or whatever.