continue in catch block? seperate interaction with widgets and work flow

davidl davidl at 126.com
Thu Oct 19 01:02:36 PDT 2006


here we consider a work flow in form 1

//code block 1
...
//feed back to form 1's widgets
...
//code block 2
...
//feed back to form 1's widgets
...

now another form, form 2's code with the same structure

//code block 1
...
//feed back to form 2's widgets
...
//code block 2
...
//feed back to form 2's widgets
...

these two funcs meet one problem , if i want to call form2's func in form1  
the feedback info wouldn't be shown in form1.
and also if i want to call form1's func in form2 the feedback info  
wouldn't be shown.

solution :
i would set up two feedback "server"s for both form1 and form2
form1 now would be:
//code block 1
...
//feedback info ----> "call" server1 to show. but we can't have a call  
directly , we need to signal the operation sysmem first, then let the os  
call our handle func
...
//code block 2
...
//feedback info ----> "call" feedback displayer  again
...

if we send the same syntax feedback info , and the displayer can  
understand that info, then we can have form2's info get shown in form1  
when form1 call form2's method


i suggest a possible solution to this
now we consider following:
try
{
}
catch
{
}

what we need is after handling the exception we need to back to the exact  
point where the exception is raised. since we get our feedback info  
handled in the catch block, but we need to go back when that display done.  
so if continue keyword is possible in catch block ? that would be nice to  
handle the problem i meet.

and if we can call that as action handler , would be nicer.
actionbegin
{
}

actionhandle(action class)
{
	switch (typeof(action))
	{	
		ActionClass1 : writefln(action.Message);
		ActionClass2 : writefln(action.message);
		...
	}
}






-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list