It is possible to pass parameters between threads:
I have the program start and I need to populate a grid but I want to do it in the background.
It is necessary to pass the type of product that should be loaded on the grid, type of wheel or tires for example:
method-id NEW.
procedure division.
invoke self :: InitializeComponent
goback.
end method.
method-id Form1_Load final private.
procedure division using by value sender as object and type System.EventArgs.
*> ------------------------------------------------ -----------------------------------
*> today I do this, fill a bindingsource but if you have a lot of registration it takes a while.
declare fPdto as type cadProdutos = new cadProdutos
set bindingSource1 :: DataSource to fPdto :: encheProdutos (Lnk-Produtos)
*> I would like to switch to a thread
*> ------------------------------------------------ -----------------------------------
declare thread1 as type Thread
declare myobject as type ThreadWork = new ThreadWork
declare threadDelegate as type ThreadStart= new ThreadStart(myobject::encheProdutos ??????)
set thread1 to new Thread(threadDelegate)
invoke thread1::Start
*> continue the program
set label15 :: Text to wNumCaixa-cfg
*> SAT directory
set w-DirSAT to w-pastaSAT-cfg
set w-DirEntSAT to w-pastaENT-cfg
set w-DirSaiSAT to w-pastaSAI-cfg
set w-DirArqVSAT to w-pastaVDA-cfg
set w-DirArqCSAT to w-pastaVDA-cfg
set wBoolean to false
set self :: Cursor to type Cursors :: Default
end method.
translated by Google



