aadowns2
New Member.
312 views

Tasks

Can you do programming in visual cobol .net using await and Task operators? I have a very simple method below and wish to use async, Task and await operators.  Is this possible in a windows form application?

 

method-id CreateUser(username as string) returning a as type Task[condition-value] async


end method.

Tags (1)
0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Tasks

We do not currently support await / async syntax. It is however still possible to use async APIs. If you would like code to execute after a Task has completed, you can use the ContinueWith method on the task that is returned from the async method.

E.g.

          declare t = CreateUser("gromit")
          invoke t::ContinueWith(
              delegate using tr as type Task[condition-value]
                  display tr::Result
              end-delegate)

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.