User Tools

Site Tools


begin_end_sequence

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
begin_end_sequence [2018/03/21 04:50] – created wolfgangriedmannbegin_end_sequence [2018/03/30 12:22] wolfgangriedmann
Line 6: Line 6:
  
 The biggest difference between the error handling in .NET and Visual Objects stays in the ErrorBlock() handling. Please see the relative topic: [[vo_errorblock|The VO ErrorBlock]] The biggest difference between the error handling in .NET and Visual Objects stays in the ErrorBlock() handling. Please see the relative topic: [[vo_errorblock|The VO ErrorBlock]]
 +
 +Unfortunately, in the ''begin sequence'' - ''end sequence'' construct seems to be a major compatibility issue. This code for example:
 +<code>local uVal1 as usual
 +local uVal2 as usual
 +local uVal3 as usual
 +
 +begin sequence  
 +  uVal1 := "Hi"
 +  uVal2 := 2
 +  uVal3 := uVal1 + uVal2
 +end sequence</code>
 +when executed in VO shows a runtime error, as expected.
 +When you execute it in X#, it does not shows any runtime error.
 +This could lead to not see runtime errors in your migrated VO application.
 +Until the X# development team is able to add some enhancements in their own runtime, you should better use the .NET ''try - catch'' statements, and if you need to remain source compatible between VO and X#, you can use code like this:
 +<code>#ifdef __XSHARP__
 +  try
 +#else
 +  begin sequence
 +#endif  
 +uVal1 := "Hi"
 +uVal2 := 2
 +uVal3 := uVal1 + uVal2
 +#ifdef __XSHARP__
 +  catch oEx as Exception
 +  ErrorBox{ nil, oEx:Message }:Show()
 +  end try
 +#else
 +  end sequence
 +#endif</code>
  
begin_end_sequence.txt · Last modified: 2019/08/29 17:57 by wolfgangriedmann