diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-255B6815-8CC8-5E4A-9999-9BC083BCCD83.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-255B6815-8CC8-5E4A-9999-9BC083BCCD83.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,28 @@ + + + + + +Using +__ASSERT_ALWAYSThis topic explains how to panic on an illegal value. +

This simple example of the use of __ASSERT_ALWAYS shows +how to panic on an illegal value.

+

Suppose the member function F() in class CMyClass, +takes a TInt argument which must always be zero or positive.

+void CMyClass::F(TInt aValue) + { + _LIT(KMyPanicDescriptor, "My panic text"); + + __ASSERT_ALWAYS(aValue >= 0,User::Panic(KMyPanicDescriptor, aValue)); + ... + /* main body of the function */ + ... + } +

If the caller passes a value which is negative, the current thread is panicked.

+
\ No newline at end of file