I have a Visual Studio 2017 COBOL question. I have a Solution of many projects and the projects all focus on a single form. From that form various projects are initiated for different processing but when returning to the originating form I don't know how to gain control of the processing without initiating something on the form (button). That means the user has to do this to finish the processing from the initiated projects (changes are made to the form). Where do I insert code that will automatically do the processing without intervention by the user?
I have a Visual Studio 2017 COBOL question. I have a Solution of many projects and the projects all focus on a single form. From that form various projects are initiated for different processing but when returning to the originating form I don't know how to gain control of the processing without initiating something on the form (button). That means the user has to do this to finish the processing from the initiated projects (changes are made to the form). Where do I insert code that will automatically do the processing without intervention by the user?
How are you currently transferring control to the other processing? Are you creating a separate thread or using a COBOL call or invoke statement, etc.? Any of these should be able to notify the main thread that it is done and to go do something else.
If you are calling a COBOL program from an event handler like a button click, then processing will return to the statement following the call within the event handler so you could continue where you left off.
You can also create your own events and trigger them. See the Samples Browser under .NET samples for Events and Delegates.
I have a Visual Studio 2017 COBOL question. I have a Solution of many projects and the projects all focus on a single form. From that form various projects are initiated for different processing but when returning to the originating form I don't know how to gain control of the processing without initiating something on the form (button). That means the user has to do this to finish the processing from the initiated projects (changes are made to the form). Where do I insert code that will automatically do the processing without intervention by the user?
method-id button2_Click final private.
local-storage section.
01 newForm Type AlterMenu.Form1.
procedure division using by value sender as object e as type System.EventArgs.
* alter a team member sustuting sub or creating a no show
Invoke type AlterMenu.Form1::New() returning newForm.
Invoke newForm::Show().
set button6::Enabled = True
move 'Process player change' to button6::Text
MOVE space to textBox1::Text
end method.
I have a Visual Studio 2017 COBOL question. I have a Solution of many projects and the projects all focus on a single form. From that form various projects are initiated for different processing but when returning to the originating form I don't know how to gain control of the processing without initiating something on the form (button). That means the user has to do this to finish the processing from the initiated projects (changes are made to the form). Where do I insert code that will automatically do the processing without intervention by the user?
So you are starting up a new form. Since you are using the Show method to display and process the form newForm both the main form and the newform will be running independently of each other.
If you place a breakpoint on the line set button6::Enabled = True you will see that after displaying newForm using Show it will execute these lines of code. If you actually wish for the main form to wait until the newform is closed then you should use ShowDialog instead of Show.
If you wish to have them run independently of each other then you will have to set up event handlers so that they can communicate with each other.
I wrote an example of how this might be done and published it to our knowledgebase here.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.