Working with exceptions
Try (For modes 2D, 3D, Console)
We put into to block try those commands that could raise an exception in program runtime.
Was this helpful?
Catch (For modes 2D, 3D, Console)
In the catch block we can process exception raised in the try block.
Was this helpful?
Finally (For modes 2D, 3D, Console)
Block finally is executed every time, even if there was an exception in the try block, and even if the exception was not processed in the catch block.
Was this helpful?
Throw (For modes 2D, 3D, Console)
Gives programmer the ability to raise an exception.
Was this helpful?
Was this helpful?
Keyword 'using' (For modes 2D, 3D, Console)
This keyword determines the scope of parameter activity.
Was this helpful?
Keyword 'lock' (For modes 2D, 3D, Console)
This keyword marks block as critical and gains exclusive rights to access given object.
Po provedení bloku príkazu je uzamcení objektu opet uvolneno.
Syntaxe:
lock(výraz)príkaz
Was this helpful?
Checked and Unchecked
Checked (For modes 2D, 3D, Console)
Enables checking overflow in aritmetic operations.
Was this helpful?
Unchecked (For modes 2D, 3D, Console)
Disables ckecking overflow in aritmetic operations for.
Was this helpful?
C# statements can execute in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated.
In a checked context, if an expression produces a value that is outside the range of the destination type, the result depends on whether the expression is constant or non-constant. Constant expressions (expression with constants and literals only) cause compile time errors, while non-constant expressions (expressions with variables) are evaluated at run time and raise exceptions.
Example (For modes 2D, 3D, Console)
Was this helpful?
Keyword 'as' (For modes 2D, 3D, Console)
Performs conversion to a different type (safe type cast)
Was this helpful?
Keyword Is (For modes 2D, 3D, Console)
Determines whether the type of an expression is the same as given type. Returns true when types are the same.
Was this helpful?


Did you find this information useful?
Documentation of SGP Baltie 4 C#
Send us comments on this topic by this form ©1978-2010 SGP Systems

Parent page | Previous page | Next page