00001
00002
00003
00004
00005
00006 #include <e32cons.h>
00007
00008
00009 LOCAL_C void UseBasicTypesL();
00010
00012
00013
00014
00016 GLDEF_C TInt E32Main()
00017 {
00018
00019
00020 TRAPD(error, UseBasicTypesL());
00021
00022 _LIT(KMsgPanic,"Error in Symbian OS Basics Lab: ");
00023 __ASSERT_ALWAYS(!error, User::Panic(KMsgPanic, error));
00024
00025 return 0;
00026 }
00027
00028
00030
00031
00032
00034 LOCAL_C void UseBasicTypesL()
00035 {
00036
00037 _LIT(KLabTitle,"Symbian OS Basics Lab");
00038
00039
00040
00041
00042
00043
00044
00045 CConsoleBase* console = Console::NewL(KLabTitle, TSize(KConsFullScreen, KConsFullScreen));
00046
00047
00048
00049
00050 const TInt KOne = 1;
00051 const TInt KTwo = 2;
00052
00053
00054
00055
00056 _LIT(KSumOutput, "%d + %d is %d\n");
00057
00058
00059
00060 _LIT(KMaxIntOutput, "TInt max: %d\n");
00061 console->Printf(KMaxIntOutput, KMaxTInt);
00062
00063 _LIT(KMinIntOutput, "TInt min: %d\n");
00064 console->Printf(KMinIntOutput, KMinTInt);
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 _LIT(KEnterSpace, "Press space to start timer\n");
00094 console->Printf(KEnterSpace);
00095
00096
00097 TKeyCode key = console->Getch();
00098 while (EKeySpace != key)
00099 {
00100 _LIT(KCharVal, "Char entered is '%c'\n");
00101
00102
00103
00104
00105
00106
00107
00108 key = console->Getch();
00109 }
00110
00111
00112
00113
00114 RTimer timer;
00115 if (KErrNone == timer.CreateLocal())
00116 {
00117 TRequestStatus status;
00118 const TTimeIntervalMicroSeconds32 KTimerInterval = 5000000;
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 }
00132 else
00133 {
00134 _LIT(KTimerError, "Error creating timer\n");
00135 console->Printf(KTimerError);
00136 }
00137
00138 timer.Close();
00139
00140
00141 _LIT(KMsgPressAnyKey,"Press any key to end");
00142 console->Printf(KMsgPressAnyKey);
00143 console->Getch();
00144
00145 delete console;
00146 }
00147
00148
00149
00150