Symbian3/SDK/Source/GUID-255B6815-8CC8-5E4A-9999-9BC083BCCD83.dita
changeset 0 89d6a7a84779
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Symbian3/SDK/Source/GUID-255B6815-8CC8-5E4A-9999-9BC083BCCD83.dita	Thu Jan 21 18:18:20 2010 +0000
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
+<!-- This component and the accompanying materials are made available under the terms of the License 
+"Eclipse Public License v1.0" which accompanies this distribution, 
+and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
+<!-- Initial Contributors:
+    Nokia Corporation - initial contribution.
+Contributors: 
+-->
+<!DOCTYPE concept
+  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
+<concept id="GUID-255B6815-8CC8-5E4A-9999-9BC083BCCD83" xml:lang="en"><title>Using
+__ASSERT_ALWAYS</title><shortdesc>This topic explains how to panic on an illegal value.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
+<p>This simple example of the use of <codeph>__ASSERT_ALWAYS</codeph> shows
+how to panic on an illegal value. </p>
+<p>Suppose the member function <codeph>F()</codeph> in class <codeph>CMyClass</codeph>,
+takes a <codeph>TInt</codeph> argument which must always be zero or positive. </p>
+<codeblock id="GUID-21213FE1-90B2-5218-BD0C-E2D598962AD6" xml:space="preserve">void CMyClass::F(TInt aValue)
+ {
+ _LIT(KMyPanicDescriptor, "My panic text");
+
+ __ASSERT_ALWAYS(aValue &gt;= 0,User::Panic(KMyPanicDescriptor, aValue));
+ ...
+ /* main body of the function */
+ ...
+ }</codeblock>
+<p>If the caller passes a value which is negative, the current thread is panicked. </p>
+</conbody></concept>
\ No newline at end of file