Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Ektoras Giorgos
New Member.
1602 views

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. 
.

Tags (1)
0 Likes
4 Replies
aw_muench Respected Contributor.
Respected Contributor.

RE: Threads

Hi Giogos,

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

What do you think ?

0 Likes
Ektoras Giorgos
New Member.

RE: Threads

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

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: 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.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: 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.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.