Programalama > VISUAL BASIC

Etiketler: bilimsel, hesap, mak.

Ort. 3
Puan ver:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
'***********************************************************************
'   Scientific Calculator Program
'   Author: Timothy C. Alvord
'   E-Mail: tim8w@yahoo.com
'
'   Purpose:
'       This program is a Simple Scientific Calculator. It handles
'       Roman Numeral, Hex, Decimal, Octal and Binary numbers.
'       Degrees, Radians and Gradians. All the standard Trig functions.
'       Factorial, Sqr, Inverse, Square, Cube, X^Y.
'       Fun conversions like:
'           Ounce <-> Grams
'           Pounds <-> Kilograms
'           Gallon <-> Litre
'           Mile <-> Kilometer
'           Inch <-> Centimeter
'           Fahrenheight <-> Celsius
'***********************************************************************
Const PI = 3.14159265358979
' Function Mode
Const NONE = 0
Const MULTIPLY = 1
Const DIVIDE = 2
Const PLUS = 3
Const MINUS = 4
Const POWER = 5
' Base
Const ROMANNUM = 1
Const HEXNUM = 2
Const DECNUM = 3
Const OCTNUM = 4
Const BINNUM = 5
' Deg/Rad/Grad
Const DEGREES = 1
Const RADIANS = 2
Const GRADIANS = 3
 
Public xFirstNum As Double
Public xSecondNum As Double
Public xMemory As Double
Public bError As Boolean
Public bEntered As Boolean
Public bFirstNum As Boolean
Public iMathFunction As Integer
Public iCurrentRadix As Integer
Public iDegRadGrad As Integer
 
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hwnd As Long, ByVal wMsg As Long, wParam As Long, _
        lParam As Any) As Long
 
Private Const BM_CLICK As Long = &HF5
Private Const BM_SETSTATE As Long = &HF3
 
Private Sub Form_Load()
    iMathFunction = NONE
    iCurrentRadix = DECNUM
    iDegRadGrad = DEGREES
    xFirstNum = 0
    xSecondNum = 0
    bError = False
    bEntered = False
     
    Call Dec_Click
End Sub
 
Private Sub Form_KeyPress(KeyCode As Integer)
     
    MyChar = Chr(KeyCode)
    Select Case (MyChar)
    Case "0"
        Call Button0_Click
    Case "1"
        Call Button1_Click
    Case "2"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button2_Click
        End If
    Case "3"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button3_Click
        End If
    Case "4"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button4_Click
        End If
    Case "5"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button5_Click
        End If
    Case "6"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button6_Click
        End If
    Case "7"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button7_Click
        End If
    Case "8"
        If Dec.Value = True Or Oct.Value = True Or Hex.Value = True Then
            Call Button8_Click
        End If
    Case "9"
        If Dec.Value = True Or Hex.Value = True Then
            Call Button9_Click
        End If
    Case "A", "a"
        If Hex.Value = True Then
            Call ButtonA_Click
        End If
    Case "B", "b"
        If Hex.Value = True Then
            Call ButtonB_Click
        End If
    Case "C", "c"
        If iCurrentRadix = ROMANNUM Or iCurrentRadix = HEXNUM Then
            Call ButtonC_Click
        End If
    Case "D", "d"
        If iCurrentRadix = ROMANNUM Or iCurrentRadix = HEXNUM Then
            Call ButtonD_Click
        End If
    Case "E", "e"
        If Hex.Value = True Then
            Call ButtonE_Click
        End If
    Case "F", "f"
        If Hex.Value = True Then
            Call ButtonF_Click
        End If
    Case "M", "m"
        If iCurrentRadix = ROMANNUM Then
            Call ButtonM_Click
        End If
    Case "L", "l"
        If iCurrentRadix = ROMANNUM Then
            Call ButtonL_Click
        End If
    Case "X", "x"
        If iCurrentRadix = ROMANNUM Then
            Call ButtonX_Click
        End If
    Case "V", "v"
        If iCurrentRadix = ROMANNUM Then
            Call ButtonV_Click
        End If
    Case "I", "i"
        If iCurrentRadix = ROMANNUM Then
            Call ButtonI_Click
        End If
    Case "."
        If Dec.Value = True Then
            Call ButtonDecPoint_Click
        End If
    Case "/"
        Call ButtonDivide_Click
    Case "*"
        Call ButtonMultiply_Click
    Case "+"
        Call ButtonPlus_Click
    Case "-"
        Call ButtonMinus_Click
    Case "="
        Call ButtonEquals_Click
    Case Else
        Select Case (KeyCode)
        Case 8      '   Backspace Key
            Call ButtonBS_Click
        Case 13     '   Enter Key - Treat as Equal Key
            Call ButtonEquals_Click
        Case 27     '   Esc Key
            Call ButtonClear_Click
        End Select
 
    End Select
End Sub
 
Private Sub Roman_Click()
    If bError = False Then
        Call ConvertOutputWindowText(iCurrentRadix, ROMANNUM)
        iCurrentRadix = ROMANNUM
        Roman.Value = True
        Hex.Value = False
        Dec.Value = False
        Oct.Value = False
        Bin.Value = False
         
        ButtonM.Enabled = True
        ButtonC.Enabled = True
        ButtonD.Enabled = True
        ButtonL.Enabled = True
        ButtonX.Enabled = True
        ButtonV.Enabled = True
        ButtonI.Enabled = True
         
        ButtonSqrRoot.Enabled = True
        ButtonFactorial.Enabled = True
        ButtonSquare.Enabled = True
        ButtonCube.Enabled = True
        ButtonPower.Enabled = True
 
        ButtonA.Enabled = False
        ButtonB.Enabled = False
        ButtonE.Enabled = False
        ButtonF.Enabled = False
        Button9.Enabled = False
        Button8.Enabled = False
        Button7.Enabled = False
        Button6.Enabled = False
        Button5.Enabled = False
        Button4.Enabled = False
        Button3.Enabled = False
        Button2.Enabled = False
        Button1.Enabled = False
        Button0.Enabled = False
        ButtonTangent.Enabled = False
        ButtonCosine.Enabled = False
        ButtonSine.Enabled = False
        ButtonOzToGram.Enabled = False
        ButtonMileToKilo.Enabled = False
        ButtonGallonToLitre.Enabled = False
        ButtonInchToCent.Enabled = False
        ButtonLbToKilo.Enabled = False
        ButtonFToC.Enabled = False
        Button1OverX.Enabled = False
        ButtonPlusMinus.Enabled = False
    End If
End Sub
 
Private Sub Hex_Click()
    If bError = False Then
        Call ConvertOutputWindowText(iCurrentRadix, HEXNUM)
        iCurrentRadix = HEXNUM
        Hex.Value = True
        Roman.Value = False
        Dec.Value = False
        Oct.Value = False
        Bin.Value = False
         
        ButtonA.Enabled = True
        ButtonB.Enabled = True
        ButtonC.Enabled = True
        ButtonD.Enabled = True
        ButtonE.Enabled = True
        ButtonF.Enabled = True
        Button9.Enabled = True
        Button8.Enabled = True
        Button7.Enabled = True
        Button6.Enabled = True
        Button5.Enabled = True
        Button4.Enabled = True
        Button3.Enabled = True
        Button2.Enabled = True
        Button1.Enabled = True
        Button0.Enabled = True
        ButtonSqrRoot.Enabled = True
        ButtonFactorial.Enabled = True
        ButtonSquare.Enabled = True
        ButtonCube.Enabled = True
        ButtonPower.Enabled = True
        ButtonPlusMinus.Enabled = True
 
        ButtonM.Enabled = False
        ButtonL.Enabled = False
        ButtonX.Enabled = False
        ButtonV.Enabled = False
        ButtonI.Enabled = False
        ButtonTangent.Enabled = False
        ButtonCosine.Enabled = False
        ButtonSine.Enabled = False
        ButtonOzToGram.Enabled = False
        ButtonMileToKilo.Enabled = False
        ButtonGallonToLitre.Enabled = False
        ButtonInchToCent.Enabled = False
        ButtonLbToKilo.Enabled = False
        ButtonFToC.Enabled = False
        Button1OverX.Enabled = False
    End If
End Sub
 
Private Sub Dec_Click()
    If bError = False Then
        Call ConvertOutputWindowText(iCurrentRadix, DECNUM)
        iCurrentRadix = DECNUM
         
        Dec.Value = True
        Roman.Value = False
        Hex.Value = False
        Oct.Value = False
        Bin.Value = False
     
        ButtonA.Enabled = False
        ButtonB.Enabled = False
        ButtonC.Enabled = False
        ButtonD.Enabled = False
        ButtonE.Enabled = False
        ButtonF.Enabled = False
        ButtonM.Enabled = False
        ButtonL.Enabled = False
        ButtonX.Enabled = False
        ButtonV.Enabled = False
        ButtonI.Enabled = False
         
        Button9.Enabled = True
        Button8.Enabled = True
        Button7.Enabled = True
        Button6.Enabled = True
        Button5.Enabled = True
        Button4.Enabled = True
        Button3.Enabled = True
        Button2.Enabled = True
        Button1.Enabled = True
        Button0.Enabled = True
        ButtonSqrRoot.Enabled = True
        Button1OverX.Enabled = True
        ButtonSquare.Enabled = True
        ButtonCube.Enabled = True
        ButtonPower.Enabled = True
        ButtonTangent.Enabled = True
        ButtonCosine.Enabled = True
        ButtonSine.Enabled = True
        ButtonOzToGram.Enabled = True
        ButtonMileToKilo.Enabled = True
        ButtonGallonToLitre.Enabled = True
        ButtonInchToCent.Enabled = True
        ButtonLbToKilo.Enabled = True
        ButtonFToC.Enabled = True
        ButtonPlusMinus.Enabled = True
    End If
End Sub
 
Private Sub Oct_Click()
    If bError = False Then
        Call ConvertOutputWindowText(iCurrentRadix, OCTNUM)
        iCurrentRadix = OCTNUM
         
        Oct.Value = True
        Roman.Value = False
        Hex.Value = False
        Dec.Value = False
        Bin.Value = False
     
        ButtonTangent.Enabled = False
        ButtonCosine.Enabled = False
        ButtonSine.Enabled = False
        ButtonOzToGram.Enabled = False
        ButtonMileToKilo.Enabled = False
        ButtonGallonToLitre.Enabled = False
        ButtonInchToCent.Enabled = False
        ButtonLbToKilo.Enabled = False
        ButtonFToC.Enabled = False
        Button1OverX.Enabled = False
        ButtonA.Enabled = False
        ButtonB.Enabled = False
        ButtonC.Enabled = False
        ButtonD.Enabled = False
        ButtonE.Enabled = False
        ButtonF.Enabled = False
        ButtonM.Enabled = False
        ButtonL.Enabled = False
        ButtonX.Enabled = False
        ButtonV.Enabled = False
        ButtonI.Enabled = False
        Button9.Enabled = False
         
        ButtonSqrRoot.Enabled = True
        ButtonSquare.Enabled = True
        ButtonCube.Enabled = True
        ButtonPower.Enabled = True
        ButtonPlusMinus.Enabled = True
        Button8.Enabled = True
        Button7.Enabled = True
        Button6.Enabled = True
        Button5.Enabled = True
        Button4.Enabled = True
        Button3.Enabled = True
        Button2.Enabled = True
        Button1.Enabled = True
        Button0.Enabled = True
    End If
End Sub
 
Private Sub Bin_Click()
    If bError = False Then
        Call ConvertOutputWindowText(iCurrentRadix, BINNUM)
        iCurrentRadix = BINNUM
         
        Bin.Value = True
        Roman.Value = False
        Hex.Value = False
        Dec.Value = False
        Oct.Value = False
     
        ButtonSqrRoot.Enabled = True
        ButtonSquare.Enabled = True
        ButtonCube.Enabled = True
        ButtonPower.Enabled = True
        ButtonPlusMinus.Enabled = True
        Button1.Enabled = True
        Button0.Enabled = True
         
        ButtonA.Enabled = False
        ButtonB.Enabled = False
        ButtonC.Enabled = False
        ButtonD.Enabled = False
        ButtonE.Enabled = False
        ButtonF.Enabled = False
        ButtonM.Enabled = False
        ButtonL.Enabled = False
        ButtonX.Enabled = False
        ButtonV.Enabled = False
        ButtonI.Enabled = False
        Button9.Enabled = False
        Button8.Enabled = False
        Button7.Enabled = False
        Button6.Enabled = False
        Button5.Enabled = False
        Button4.Enabled = False
        Button3.Enabled = False
        Button2.Enabled = False
        ButtonTangent.Enabled = False
        ButtonCosine.Enabled = False
        ButtonSine.Enabled = False
        ButtonOzToGram.Enabled = False
        ButtonMileToKilo.Enabled = False
        ButtonGallonToLitre.Enabled = False
        ButtonInchToCent.Enabled = False
        ButtonLbToKilo.Enabled = False
        ButtonFToC.Enabled = False
        Button1OverX.Enabled = False
    End If
End Sub
Private Sub Deg_Click()
        Deg.Value = True
        Rad.Value = False
        Grad.Value = False
        iDegRadGrad = DEGREES
End Sub
Private Sub Rad_Click()
        Deg.Value = False
        Rad.Value = True
        Grad.Value = False
        iDegRadGrad = RADIANS
End Sub
Private Sub Grad_Click()
        Deg.Value = False
        Rad.Value = False
        Grad.Value = True
        iDegRadGrad = GRADIANS
End Sub
Private Sub ButtonPI_Click()
    If bError = False Then
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(PI)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(PI)
            Case DECNUM
                OutputWindow.Text = PI
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(PI)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(PI)
        End Select
        bEntered = True
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonClear_Click()
    bEntered = False
    bFirstNum = False
    OutputWindow.Text = "0."
    OutputWindow.ForeColor = &H0&
    iMathFunction = 0
    bError = False
    Call ButtonMC_Click
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonCE_Click()
    If bError = False Then
        If bEntered = True Then
            If bFirstNum = False Then   '   Same as Clear
                bEntered = False
                bFirstNum = False
                OutputWindow.Text = "0."
                iMathFunction = 0
            Else    '   Allow User to Enter a new 2nd Number
                bEntered = False
                OutputWindow.Text = "0."
            End If
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonBS_Click()
    If bError = False Then
        If bEntered = True Then
            sStr = OutputWindow.Text
            If Len(sStr) > 1 Then
                OutputWindow.Text = Left(sStr, Len(sStr) - 1)
            Else
                OutputWindow.Text = "0"
            End If
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button0_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "0"
        Else
            OutputWindow.Text = OutputWindow.Text + "0"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button1_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "1"
        Else
            OutputWindow.Text = OutputWindow.Text + "1"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button2_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "2"
        Else
            OutputWindow.Text = OutputWindow.Text + "2"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button3_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "3"
        Else
            OutputWindow.Text = OutputWindow.Text + "3"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button4_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "4"
        Else
            OutputWindow.Text = OutputWindow.Text + "4"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button5_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "5"
        Else
            OutputWindow.Text = OutputWindow.Text + "5"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button6_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "6"
        Else
            OutputWindow.Text = OutputWindow.Text + "6"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button7_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "7"
        Else
            OutputWindow.Text = OutputWindow.Text + "7"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button8_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "8"
        Else
            OutputWindow.Text = OutputWindow.Text + "8"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub Button9_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "9"
        Else
            OutputWindow.Text = OutputWindow.Text + "9"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonA_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "A"
        Else
            OutputWindow.Text = OutputWindow.Text + "A"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonB_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "B"
        Else
            OutputWindow.Text = OutputWindow.Text + "B"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonC_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "C"
        Else
            OutputWindow.Text = OutputWindow.Text + "C"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonD_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "D"
        Else
            OutputWindow.Text = OutputWindow.Text + "D"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonE_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "E"
        Else
            OutputWindow.Text = OutputWindow.Text + "E"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonF_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "F"
        Else
            OutputWindow.Text = OutputWindow.Text + "F"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonM_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "M"
        Else
            OutputWindow.Text = OutputWindow.Text + "M"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonL_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "L"
        Else
            OutputWindow.Text = OutputWindow.Text + "L"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonX_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "X"
        Else
            OutputWindow.Text = OutputWindow.Text + "X"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonV_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "V"
        Else
            OutputWindow.Text = OutputWindow.Text + "V"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonI_Click()
    If bError = False Then
        If bEntered = False Then
            bEntered = True
            OutputWindow.Text = "I"
        Else
            OutputWindow.Text = OutputWindow.Text + "I"
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonDecPoint_Click()
    If bError = False Then
        If iCurrentRadix = DECNUM Then
            If bEntered = False Then    '   Start of New Number
                bEntered = True
                OutputWindow.Text = "."
            Else                        '   Append
                If InStr(OutputWindow.Text, ".") = 0 Then   '   Make Sure Only 1 Decimal Point
                    OutputWindow.Text = OutputWindow.Text + "."
                End If
            End If
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonPlusMinus_Click()
    If bError = False Then
        If iCurrentRadix = DECNUM Then
            If bEntered = True Then
                iValue = OutputWindow.Text * -1
                OutputWindow.Text = iValue
            End If
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonDivide_Click()
    If bError = False Then
        If bEntered = True Then
            If bFirstNum = True Then
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xSecondNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xSecondNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xSecondNum = OutputWindow.Text
                    Case OCTNUM
                        xSecondNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xSecondNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bError = Calculate_Total(xFirstNum, xSecondNum, xTotal)
                If Not bError Then
                    xFirstNum = xTotal
                    bFirstNum = True
                    bEntered = False
                    iMathFunction = DIVIDE
                End If
            Else
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xFirstNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xFirstNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xFirstNum = OutputWindow.Text
                    Case OCTNUM
                        xFirstNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xFirstNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bFirstNum = True
                bEntered = False
                iMathFunction = DIVIDE
            End If
        Else
            iMathFunction = DIVIDE
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMultiply_Click()
    If bError = False Then
        If bEntered = True Then
            If bFirstNum = True Then
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xSecondNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xSecondNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xSecondNum = OutputWindow.Text
                    Case OCTNUM
                        xSecondNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xSecondNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bError = Calculate_Total(xFirstNum, xSecondNum, xTotal)
                If Not bError Then
                    xFirstNum = xTotal
                    bFirstNum = True
                    bEntered = False
                    iMathFunction = MULTIPLY
                End If
           Else
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xFirstNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xFirstNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xFirstNum = OutputWindow.Text
                    Case OCTNUM
                        xFirstNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xFirstNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bFirstNum = True
                bEntered = False
                iMathFunction = MULTIPLY
            End If
        Else
            iMathFunction = MULTIPLY
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonPlus_Click()
    If bError = False Then
        If bEntered = True Then
            If bFirstNum = True Then
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xSecondNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xSecondNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xSecondNum = OutputWindow.Text
                    Case OCTNUM
                        xSecondNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xSecondNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bError = Calculate_Total(xFirstNum, xSecondNum, xTotal)
                If Not bError Then
                    xFirstNum = xTotal
                    bFirstNum = True
                    bEntered = False
                    iMathFunction = PLUS
                End If
            Else
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xFirstNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xFirstNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xFirstNum = OutputWindow.Text
                    Case OCTNUM
                        xFirstNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xFirstNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bFirstNum = True
                bEntered = False
                iMathFunction = PLUS
            End If
        Else
            iMathFunction = PLUS
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMinus_Click()
    If bError = False Then
        If bEntered = True Then
            If bFirstNum = True Then
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xSecondNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xSecondNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xSecondNum = OutputWindow.Text
                    Case OCTNUM
                        xSecondNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xSecondNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bError = Calculate_Total(xFirstNum, xSecondNum, xTotal)
                If Not bError Then
                    xFirstNum = xTotal
                    bFirstNum = True
                    bEntered = False
                    iMathFunction = MINUS
                End If
            Else
                Select Case iCurrentRadix
                    Case ROMANNUM
                        xFirstNum = GetRomanDecNum(OutputWindow.Text)
                    Case HEXNUM
                        xFirstNum = Val("&H" + OutputWindow.Text)
                    Case DECNUM
                        xFirstNum = OutputWindow.Text
                    Case OCTNUM
                        xFirstNum = Val("&O" + OutputWindow.Text)
                    Case BINNUM
                        xFirstNum = GetBinDecNum(OutputWindow.Text)
                End Select
                bFirstNum = True
                bEntered = False
                iMathFunction = MINUS
            End If
        Else
            iMathFunction = MINUS
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonPower_Click()
    If bError = False Then
        If bEntered = True Then
            Select Case iCurrentRadix
                Case ROMANNUM
                    xFirstNum = GetRomanDecNum(OutputWindow.Text)
                Case HEXNUM
                    xFirstNum = Val("&H" + OutputWindow.Text)
                Case DECNUM
                    xFirstNum = OutputWindow.Text
                Case OCTNUM
                    xFirstNum = Val("&O" + OutputWindow.Text)
                Case BINNUM
                    xFirstNum = GetBinDecNum(OutputWindow.Text)
            End Select
            bFirstNum = True
            bEntered = False
            iMathFunction = POWER
        End If
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonEquals_Click()
    If bError = False Then
        If bFirstNum = True Then
            Select Case iCurrentRadix
                Case ROMANNUM
                    xSecondNum = GetRomanDecNum(OutputWindow.Text)
                Case HEXNUM
                    xSecondNum = Val("&H" + OutputWindow.Text)
                Case DECNUM
                    xSecondNum = OutputWindow.Text
                Case OCTNUM
                    xSecondNum = Val("&O" + OutputWindow.Text)
                Case BINNUM
                    xSecondNum = GetBinDecNum(OutputWindow.Text)
            End Select
             
            Select Case iMathFunction
            Case DIVIDE
                If xSecondNum = 0 Then
                    OutputWindow.Text = "ERROR - Divide by Zero"
                    OutputWindow.ForeColor = &HFF&
                    bError = True
                Else
                    xTotal = xFirstNum / xSecondNum
                    Select Case iCurrentRadix
                        Case ROMANNUM
                            OutputWindow.Text = GetDecRomanStr(xTotal)
                        Case HEXNUM
                            OutputWindow.Text = GetDecHexStr(xTotal)
                        Case DECNUM
                            OutputWindow.Text = xTotal
                        Case OCTNUM
                            OutputWindow.Text = GetDecOctStr(xTotal)
                        Case BINNUM
                            OutputWindow.Text = GetDecBinStr(xTotal)
                    End Select
                     
                    xFirstNum = xTotal
                    bFirstNum = True
                    bEntered = False
                End If
                iMathFunction = 0
            Case MULTIPLY
                xTotal = xFirstNum * xSecondNum
                Select Case iCurrentRadix
                    Case ROMANNUM
                        OutputWindow.Text = GetDecRomanStr(xTotal)
                    Case HEXNUM
                        OutputWindow.Text = GetDecHexStr(xTotal)
                    Case DECNUM
                        OutputWindow.Text = xTotal
                    Case OCTNUM
                        OutputWindow.Text = GetDecOctStr(xTotal)
                    Case BINNUM
                        OutputWindow.Text = GetDecBinStr(xTotal)
                End Select
                 
                xFirstNum = xTotal
                bFirstNum = True
                bEntered = False
                iMathFunction = 0
            Case PLUS
                xTotal = xFirstNum + xSecondNum
                Select Case iCurrentRadix
                    Case ROMANNUM
                        OutputWindow.Text = GetDecRomanStr(xTotal)
                    Case HEXNUM
                        OutputWindow.Text = GetDecHexStr(xTotal)
                    Case DECNUM
                        OutputWindow.Text = xTotal
                    Case OCTNUM
                        OutputWindow.Text = GetDecOctStr(xTotal)
                    Case BINNUM
                        OutputWindow.Text = GetDecBinStr(xTotal)
                End Select
                 
                xFirstNum = xTotal
                bFirstNum = True
                bEntered = False
                iMathFunction = 0
            Case MINUS
                xTotal = xFirstNum - xSecondNum
                Select Case iCurrentRadix
                    Case ROMANNUM
                        OutputWindow.Text = GetDecRomanStr(xTotal)
                    Case HEXNUM
                        OutputWindow.Text = GetDecHexStr(xTotal)
                    Case DECNUM
                        OutputWindow.Text = xTotal
                    Case OCTNUM
                        OutputWindow.Text = GetDecOctStr(xTotal)
                    Case BINNUM
                        OutputWindow.Text = GetDecBinStr(xTotal)
                End Select
                xFirstNum = xTotal
                bFirstNum = True
                bEntered = False
                iMathFunction = 0
            Case POWER
                xTotal = 1
                If xSecondNum <> 0 Then
                    For iCounter = 1 To xSecondNum
                        xTotal = xTotal * xFirstNum
                    Next
                End If
                Select Case iCurrentRadix
                    Case ROMANNUM
                        OutputWindow.Text = GetDecRomanStr(xTotal)
                    Case HEXNUM
                        OutputWindow.Text = GetDecHexStr(xTotal)
                    Case DECNUM
                        OutputWindow.Text = xTotal
                    Case OCTNUM
                        OutputWindow.Text = GetDecOctStr(xTotal)
                    Case BINNUM
                        OutputWindow.Text = GetDecBinStr(xTotal)
                End Select
                xFirstNum = xTotal
                bFirstNum = True
                bEntered = False
                iMathFunction = 0
            End Select
        End If
    End If
    OutputWindow.SetFocus
End Sub
Private Sub ButtonMC_Click()
    xMemory = 0
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMR_Click()
    If xMemory <> 0 Then
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(xMemory)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(xMemory)
            Case DECNUM
                OutputWindow.Text = xMemory
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(xMemory)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(xMemory)
        End Select
        bEntered = True
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMS_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xMemory = GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xMemory = Val("&H" + OutputWindow.Text)
        Case DECNUM
            xMemory = OutputWindow.Text
        Case OCTNUM
            xMemory = Val("&O" + OutputWindow.Text)
        Case BINNUM
            xMemory = GetBinDecNum(OutputWindow.Text)
    End Select
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMPlus_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xMemory = xMemory + GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xMemory = xMemory + Val("&H" + OutputWindow.Text)
        Case DECNUM
            xMemory = xMemory + OutputWindow.Text
        Case OCTNUM
            xMemory = xMemory + Val("&O" + OutputWindow.Text)
        Case BINNUM
            xMemory = xMemory + GetBinDecNum(OutputWindow.Text)
    End Select
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMMinus_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xMemory = xMemory - GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xMemory = xMemory - Val("&H" + OutputWindow.Text)
        Case DECNUM
            xMemory = xMemory - OutputWindow.Text
        Case OCTNUM
            xMemory = xMemory - Val("&O" + OutputWindow.Text)
        Case BINNUM
            xMemory = xMemory - GetBinDecNum(OutputWindow.Text)
    End Select
    OutputWindow.SetFocus
End Sub
 
Private Sub InvCheckBox_Click()
    If InvCheckBox.Value = True Then
        ButtonOzToGram.Caption = "Gm-Oz"
        ButtonMileToKilo.Caption = "Km-Mi"
        ButtonGallonToLitre.Caption = "Ltr-Gal"
        ButtonInchToCent.Caption = "Cm-In"
        ButtonFToC.Caption = "C - F"
        ButtonLbToKilo.Caption = "Kg-Lb"
        ButtonSine.Caption = "Asn"
        ButtonCosine.Caption = "Acs"
        ButtonTangent.Caption = "Atn"
    Else
        ButtonOzToGram.Caption = "Oz-Gm"
        ButtonMileToKilo.Caption = "Mi-Km"
        ButtonGallonToLitre.Caption = "Gal-Ltr"
        ButtonInchToCent.Caption = "In-Cm"
        ButtonFToC.Caption = "F - C"
        ButtonLbToKilo.Caption = "Lb-Kg"
        ButtonSine.Caption = "Sin"
        ButtonCosine.Caption = "Cos"
        ButtonTangent.Caption = "Tan"
    End If
    OutputWindow.SetFocus
End Sub
Private Sub ButtonOzToGram_Click()
    If InvCheckBox.Value = True Then
        xGram = OutputWindow.Text
        xOunce = xGram / 28.34952313
        OutputWindow.Text = xOunce
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xOunce = OutputWindow.Text
        xGram = xOunce * 28.34952313
        OutputWindow.Text = xGram
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonMileToKilo_Click()
    If InvCheckBox.Value = True Then
        xKilometer = OutputWindow.Text
        xMile = xKilometer / 1.609344
        OutputWindow.Text = xMile
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xMile = OutputWindow.Text
        xKilometer = xMile * 1.609344
        OutputWindow.Text = xKilometer
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonGallonToLitre_Click()
    If InvCheckBox.Value = True Then
        xLitre = OutputWindow.Text
        xGallon = xLitre / 3.785412
        OutputWindow.Text = xGallon
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xGallon = OutputWindow.Text
        xLitre = xGallon * 3.785412
        OutputWindow.Text = xLitre
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonInchToCent_Click()
    If InvCheckBox.Value = True Then
        xCent = OutputWindow.Text
        xInch = xCent / 2.54
        OutputWindow.Text = xInch
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xInch = OutputWindow.Text
        xCent = xInch * 2.54
        OutputWindow.Text = xCent
    End If
    OutputWindow.SetFocus
End Sub
Private Sub ButtonFToC_Click()
    If InvCheckBox.Value = True Then
        xCelsius = OutputWindow.Text
        xFahrenheit = 32 + (9 * xCelsius / 5)
        OutputWindow.Text = xFahrenheit
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xFahrenheit = OutputWindow.Text
        xCelsius = ((xFahrenheit - 32) * 5) / 9
        OutputWindow.Text = xCelsius
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonLbToKilo_Click()
    If InvCheckBox.Value = True Then
        xKilograms = OutputWindow.Text
        xPounds = xKilograms * 2.204623
        OutputWindow.Text = xPounds
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        xPounds = OutputWindow.Text
        xKilograms = xPounds / 2.204623
        OutputWindow.Text = xKilograms
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonSine_Click()
    If InvCheckBox.Value = True Then
        xAsin = ArcSin(OutputWindow.Text)
        If bError Then Exit Sub
        Select Case iDegRadGrad
            Case DEGREES
                OutputWindow.Text = xAsin * 180 / PI
            Case RADIANS
                OutputWindow.Text = xAsin
            Case GRADIANS
                xDeg = xAsin * 180 / PI
                OutputWindow.Text = xDeg * 10 / 9
        End Select
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        Select Case iDegRadGrad
            Case DEGREES
                xsin = Sin(OutputWindow.Text * PI / 180)
            Case RADIANS
                xsin = Sin(OutputWindow.Text)
            Case GRADIANS
                xDeg = (OutputWindow.Text * 9) / 10
                xsin = Sin(xDeg * PI / 180)
        End Select
        OutputWindow.Text = xsin
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonCosine_Click()
    If InvCheckBox.Value = True Then
        xAcos = ArcCos(OutputWindow.Text)
        If bError Then Exit Sub
        Select Case iDegRadGrad
            Case DEGREES
                OutputWindow.Text = xAcos * 180 / PI
            Case RADIANS
                OutputWindow.Text = xAcos
            Case GRADIANS
                xDeg = xAcos * 10 / 9
                OutputWindow.Text = xDeg * 180 / PI
        End Select
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        Select Case iDegRadGrad
            Case DEGREES
                xcos = Cos(OutputWindow.Text * PI / 180)
            Case RADIANS
                xcos = Cos(OutputWindow.Text)
            Case GRADIANS
                xDeg = (OutputWindow.Text * 9) / 10
                xcos = Cos(xDeg * PI / 180)
        End Select
        OutputWindow.Text = xcos
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonTangent_Click()
    If InvCheckBox.Value = True Then
        xAtan = Atn(OutputWindow.Text)
        Select Case iDegRadGrad
            Case DEGREES
                OutputWindow.Text = xAtan * 180 / PI
            Case RADIANS
                OutputWindow.Text = xAtan
            Case GRADIANS
                xDeg = xAtan * 180 / PI
                OutputWindow.Text = xDeg * 10 / 9
        End Select
        InvCheckBox.Value = False
        Call InvCheckBox_Click
    Else
        Select Case iDegRadGrad
            Case DEGREES
                xtan = Tan(OutputWindow.Text * PI / 180)
            Case RADIANS
                xtan = Tan(OutputWindow.Text)
            Case GRADIANS
                xDeg = (OutputWindow.Text * 9) / 10
                xtan = Tan(xDeg * PI / 180)
        End Select
        OutputWindow.Text = xtan
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonSquare_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xNum = GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xNum = Val("&H" + OutputWindow.Text)
        Case DECNUM
            xNum = OutputWindow.Text
        Case OCTNUM
            xNum = Val("&O" + OutputWindow.Text)
        Case BINNUM
            xNum = GetBinDecNum(OutputWindow.Text)
    End Select
    xNum = xNum * xNum
    Select Case iCurrentRadix
        Case ROMANNUM
            OutputWindow.Text = GetDecRomanStr(xNum)
        Case HEXNUM
            OutputWindow.Text = GetDecHexStr(xNum)
        Case DECNUM
            OutputWindow.Text = xNum
        Case OCTNUM
            OutputWindow.Text = GetDecOctStr(xNum)
        Case BINNUM
            OutputWindow.Text = GetDecBinStr(xNum)
    End Select
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonCube_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xNum = GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xNum = Val("&H" + OutputWindow.Text)
        Case DECNUM
            xNum = OutputWindow.Text
        Case OCTNUM
            xNum = Val("&O" + OutputWindow.Text)
        Case BINNUM
            xNum = GetBinDecNum(OutputWindow.Text)
    End Select
    xNum = xNum * xNum * xNum
    Select Case iCurrentRadix
        Case ROMANNUM
            OutputWindow.Text = GetDecRomanStr(xNum)
        Case HEXNUM
            OutputWindow.Text = GetDecHexStr(xNum)
        Case DECNUM
            OutputWindow.Text = xNum
        Case OCTNUM
            OutputWindow.Text = GetDecOctStr(xNum)
        Case BINNUM
            OutputWindow.Text = GetDecBinStr(xNum)
    End Select
    OutputWindow.SetFocus
End Sub
Public Function ArcSin(x As Variant) As Variant
    Select Case x
        Case -1
            ArcSin = 6 * Atn(1)
        Case 0:
            ArcSin = 0
        Case 1:
            ArcSin = 2 * Atn(1)
        Case Else:
            ArcSin = Atn(x / Sqr(-x * x + 1))
    End Select
End Function
Public Function ArcCos(x As Variant) As Variant
 
    Select Case x
        Case -1
            ArcCos = 4 * Atn(1)
              
        Case 0:
            ArcCos = 2 * Atn(1)
              
        Case 1:
            ArcCos = 0
              
        Case Else:
            ArcCos = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
    End Select
End Function
 
Private Sub Button1OverX_Click()
    xValue = OutputWindow.Text
    If xValue = 0 Then
        OutputWindow.Text = "ERROR - Divide by Zero"
        OutputWindow.ForeColor = &HFF&
        bError = True
    Else
        OutputWindow.Text = 1 / xValue
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonSqrRoot_Click()
    Select Case iCurrentRadix
        Case ROMANNUM
            xValue = GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xValue = Val("&H" + OutputWindow.Text)
        Case DECNUM
            xValue = OutputWindow.Text
        Case OCTNUM
            xValue = Val("&O" + OutputWindow.Text)
        Case BINNUM
            xValue = GetBinDecNum(OutputWindow.Text)
    End Select
    If xValue < 0 Then
        OutputWindow.Text = "ERROR - Square Root of Negative Number"
        OutputWindow.ForeColor = &HFF&
        bError = True
    Else
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(Sqr(xValue))
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(Sqr(xValue))
            Case DECNUM
                OutputWindow.Text = Sqr(xValue)
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(Sqr(xValue))
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(Sqr(xValue))
        End Select
    End If
    OutputWindow.SetFocus
End Sub
 
Private Sub ButtonFactorial_Click()
    Dim xFactorial, xNum As Double
     
    Select Case iCurrentRadix
        Case ROMANNUM
            xNum = GetRomanDecNum(OutputWindow.Text)
        Case HEXNUM
            xNum = Val("&H" + OutputWindow.Text)
        Case DECNUM
            xNum = OutputWindow.Text
        Case OCTNUM
            xNum = Val("&O" + OutputWindow.Text)
        Case BINNUM
            xNum = GetBinDecNum(OutputWindow.Text)
    End Select
    xFactorial = xNum
    On Error GoTo Factorial_Error
    For iCounter = (xFactorial - 1) To 1 Step -1
        xFactorial = xFactorial * iCounter
    Next
    Select Case iCurrentRadix
        Case ROMANNUM
            OutputWindow.Text = GetDecRomanStr(xFactorial)
        Case HEXNUM
            OutputWindow.Text = GetDecHexStr(xFactorial)
        Case DECNUM
            OutputWindow.Text = xFactorial
        Case OCTNUM
            OutputWindow.Text = GetDecOctStr(xFactorial)
        Case BINNUM
            OutputWindow.Text = GetDecBinStr(xFactorial)
    End Select
    OutputWindow.SetFocus
    Exit Sub
     
Factorial_Error:
    OutputWindow.Text = "ERROR - " + Err.Description
    OutputWindow.ForeColor = &HFF&
    bError = True
    Err.Clear
    OutputWindow.SetFocus
End Sub
 
Public Function GetDecRomanStr(ByVal xDecimal As Double) As String
    Dim iThousands, iHundreds, iTens, iOnes As Integer
    Dim sReturnStr As String
    Dim sHunds(9) As String
    Dim sTens(9) As String
    Dim sOnes(9) As String
     
    sHunds(1) = "C"
    sHunds(2) = "CC"
    sHunds(3) = "CCC"
    sHunds(4) = "CD"
    sHunds(5) = "D"
    sHunds(6) = "DC"
    sHunds(7) = "DCC"
    sHunds(8) = "DCCC"
    sHunds(9) = "CM"
    sTens(1) = "X"
    sTens(2) = "XX"
    sTens(3) = "XXX"
    sTens(4) = "XL"
    sTens(5) = "L"
    sTens(6) = "LX"
    sTens(7) = "LXX"
    sTens(8) = "LXXX"
    sTens(9) = "XC"
    sOnes(1) = "I"
    sOnes(2) = "II"
    sOnes(3) = "III"
    sOnes(4) = "IV"
    sOnes(5) = "V"
    sOnes(6) = "VI"
    sOnes(7) = "VII"
    sOnes(8) = "VIII"
    sOnes(9) = "IX"
     
    iThousands = (xDecimal - (xDecimal Mod 1000)) / 1000
    xDecimal = xDecimal Mod 1000
    iHundreds = (xDecimal - (xDecimal Mod 100)) / 100
    xDecimal = xDecimal Mod 100
    iTens = (xDecimal - (xDecimal Mod 10)) / 10
    xDecimal = xDecimal Mod 10
    iOnes = xDecimal
     
    sReturnStr = ""
    For iCount = 1 To iThousands
        sReturnStr = sReturnStr + "M"
    Next
    If iHundreds > 0 Then
        sReturnStr = sReturnStr + sHunds(iHundreds)
    End If
    If iTens > 0 Then
        sReturnStr = sReturnStr + sTens(iTens)
    End If
    If iOnes > 0 Then
        sReturnStr = sReturnStr + sOnes(iOnes)
    End If
    GetDecRomanStr = sReturnStr
End Function
 
Public Function GetRomanDecNum(ByVal sRomanStr As String) As Double
    Dim xDecimal As Double
    Dim sStr As String
         
    sStr = Left(sRomanStr, 1)
    While sStr = "M"
        xDecimal = xDecimal + 1000
        sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
        sStr = Left(sRomanStr, 1)
    Wend
     
    iHunds = 0
    If Left(sRomanStr, 2) = "CM" Then
        iHunds = 9
        sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
    Else
        If Left(sRomanStr, 1) = "D" Then
            iHunds = 5
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
        Else
            If Left(sRomanStr, 2) = "CD" Then
                iHunds = 4
                sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
            End If
        End If
    End If
    If iHunds = 0 Or iHunds = 5 Then
        sStr = Left(sRomanStr, 1)
        While sStr = "C"
            iHunds = iHunds + 1
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
            sStr = Left(sRomanStr, 1)
        Wend
    End If
    xDecimal = xDecimal + iHunds * 100
     
    iTens = 0
    If Left(sRomanStr, 2) = "XC" Then
        iTens = 9
        sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
    Else
        If Left(sRomanStr, 1) = "L" Then
            iTens = 5
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
        Else
            If Left(sRomanStr, 2) = "XL" Then
                iTens = 4
                sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
            End If
        End If
    End If
    If iTens = 0 Or iTens = 5 Then
        sStr = Left(sRomanStr, 1)
        While sStr = "X"
            iTens = iTens + 1
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
            sStr = Left(sRomanStr, 1)
        Wend
    End If
    xDecimal = xDecimal + iTens * 10
     
    iOnes = 0
    If Left(sRomanStr, 2) = "IX" Then
        iOnes = 9
        sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
    Else
        If Left(sRomanStr, 1) = "V" Then
            iOnes = 5
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
        Else
            If Left(sRomanStr, 2) = "IV" Then
                iOnes = 4
                sRomanStr = Right(sRomanStr, Len(sRomanStr) - 2)
            End If
        End If
    End If
    If iOnes = 0 Or iOnes = 5 Then
        sStr = Left(sRomanStr, 1)
        While sStr = "I"
            iOnes = iOnes + 1
            sRomanStr = Right(sRomanStr, Len(sRomanStr) - 1)
            sStr = Left(sRomanStr, 1)
        Wend
    End If
    xDecimal = xDecimal + iOnes
 
    GetRomanDecNum = xDecimal
End Function
 
Public Function GetDecHexStr(ByVal xDecimal As Double) As String
    Dim sReturnStr As String
    Dim lQuotient As Long
         
    iRemainder = xDecimal Mod 16
    lQuotient = xDecimal \ 16
     
    While lQuotient > 0
        sReturnStr = sReturnStr + GetHexDigit(iRemainder)
        xDecimal = lQuotient
        iRemainder = xDecimal Mod 16
        lQuotient = xDecimal \ 16
    Wend
    If iRemainder > 0 Then
        sReturnStr = sReturnStr + GetHexDigit(iRemainder)
    End If
    GetDecHexStr = StrReverse(sReturnStr)
     
End Function
 
Public Function GetHexDigit(ByVal iDigit As Integer) As String
    Dim sReturnStr As String
     
    Select Case iDigit
    Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
        sReturnStr = CStr(iDigit)
    Case "10"
        sReturnStr = "A"
    Case "11"
        sReturnStr = "B"
    Case "12"
        sReturnStr = "C"
    Case "13"
        sReturnStr = "D"
    Case "14"
        sReturnStr = "E"
    Case "15"
        sReturnStr = "F"
    End Select
    GetHexDigit = sReturnStr
 
End Function
 
Public Function GetDecOctStr(ByVal xDecimal As Double) As String
 
    Dim sReturnStr As String
    Dim lQuotient As Long
         
    iRemainder = xDecimal Mod 8
    lQuotient = xDecimal \ 8
     
    Do While lQuotient > 0
        sReturnStr = sReturnStr + CStr(iRemainder)
        xDecimal = lQuotient
        iRemainder = xDecimal Mod 8
        lQuotient = xDecimal \ 8
    Loop
    If iRemainder > 0 Then
        sReturnStr = sReturnStr + CStr(iRemainder)
    End If
    GetDecOctStr = StrReverse(sReturnStr)
     
End Function
 
Public Function GetDecBinStr(ByVal xDecimal As Double) As String
 
    Dim sReturnStr As String
    Dim lQuotient As Long
         
    iRemainder = xDecimal Mod 2
    lQuotient = xDecimal \ 2
     
    Do While lQuotient > 0
        sReturnStr = sReturnStr + CStr(iRemainder)
        xDecimal = lQuotient
        iRemainder = xDecimal Mod 2
        lQuotient = xDecimal \ 2
    Loop
    If iRemainder > 0 Then
        sReturnStr = sReturnStr + CStr(iRemainder)
    End If
    GetDecBinStr = StrReverse(sReturnStr)
     
End Function
Public Function GetBinDecNum(ByVal sBinStr As String) As Double
    Dim iLength, Counter As Integer
    Dim xReturnVal As Double
    Dim sNewString As String
         
    xReturnVal = 0
    iLength = Len(sBinStr)
    sNewString = StrReverse(sBinStr)
    For Counter = 0 To iLength - 1
        xReturnVal = xReturnVal + Left(sNewString, 1) * 2 ^ Counter
        sNewString = Right(sNewString, Len(sNewString) - 1)
    Next
     
    GetBinDecNum = xReturnVal
 
End Function
 
Public Sub ConvertOutputWindowText(ByVal iOldRadix As Integer, ByVal iNewRadix As Integer)
    Select Case (iOldRadix)
        Case ROMANNUM
            Select Case (iNewRadix)
                Case HEXNUM
                    xDecimal = GetRomanDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecHexStr(xDecimal)
                Case DECNUM
                    xDecimal = GetRomanDecNum(OutputWindow.Text)
                    OutputWindow.Text = xDecimal
                Case OCTNUM
                    xDecimal = GetRomanDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecOctStr(xDecimal)
                Case BINNUM
                    xDecimal = GetRomanDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecBinStr(xDecimal)
            End Select
        Case HEXNUM
            Select Case (iNewRadix)
                Case ROMANNUM
                    xDecimal = Val("&H" + OutputWindow.Text)
                    OutputWindow.Text = GetDecRomanStr(xDecimal)
                Case DECNUM
                    OutputWindow.Text = Val("&H" + OutputWindow.Text)
                Case OCTNUM
                    OutputWindow.Text = Val("&H" + OutputWindow.Text)
                    OutputWindow.Text = GetDecOctStr(OutputWindow.Text)
                Case BINNUM
                    OutputWindow.Text = Val("&H" + OutputWindow.Text)
                    OutputWindow.Text = GetDecBinStr(OutputWindow.Text)
            End Select
        Case DECNUM
            Select Case (iNewRadix)
                Case ROMANNUM
                    OutputWindow.Text = GetDecRomanStr(OutputWindow.Text)
                Case HEXNUM
                    OutputWindow.Text = GetDecHexStr(OutputWindow.Text)
                Case OCTNUM
                    OutputWindow.Text = GetDecOctStr(OutputWindow.Text)
                Case BINNUM
                    OutputWindow.Text = GetDecBinStr(OutputWindow.Text)
            End Select
        Case OCTNUM
            Select Case (iNewRadix)
                Case ROMANNUM
                    xDecimal = Val("&O" + OutputWindow.Text)
                    OutputWindow.Text = GetDecRomanStr(xDecimal)
                Case HEXNUM
                    OutputWindow.Text = Val("&O" + OutputWindow.Text)
                    OutputWindow.Text = GetDecHexStr(OutputWindow.Text)
                Case DECNUM
                    OutputWindow.Text = Val("&O" + OutputWindow.Text)
                Case BINNUM
                    OutputWindow.Text = Val("&O" + OutputWindow.Text)
                    OutputWindow.Text = GetDecBinStr(OutputWindow.Text)
            End Select
        Case BINNUM
            Select Case (iNewRadix)
                Case ROMANNUM
                    xDecimal = GetBinDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecRomanStr(xDecimal)
                Case HEXNUM
                    OutputWindow.Text = GetBinDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecHexStr(OutputWindow.Text)
                Case DECNUM
                    OutputWindow.Text = GetBinDecNum(OutputWindow.Text)
                Case OCTNUM
                    OutputWindow.Text = GetBinDecNum(OutputWindow.Text)
                    OutputWindow.Text = GetDecOctStr(OutputWindow.Text)
            End Select
    End Select
End Sub
 
Private Function Calculate_Total(dFirstNum, dSecondNum, dTotal) As Boolean
    Select Case iMathFunction
    Case DIVIDE
        If dSecondNum = 0 Then
            OutputWindow.Text = "ERROR - Divide by Zero"
            OutputWindow.ForeColor = &HFF&
            Calculate_Total = True
        Else
            dTotal = dFirstNum / dSecondNum
            Select Case iCurrentRadix
                Case ROMANNUM
                    OutputWindow.Text = GetDecRomanStr(dTotal)
                Case HEXNUM
                    OutputWindow.Text = GetDecHexStr(dTotal)
                Case DECNUM
                    OutputWindow.Text = dTotal
                Case OCTNUM
                    OutputWindow.Text = GetDecOctStr(dTotal)
                Case BINNUM
                    OutputWindow.Text = GetDecBinStr(dTotal)
            End Select
             
            xFirstNum = dTotal
            bFirstNum = True
            bEntered = True
        End If
        iMathFunction = 0
    Case MULTIPLY
        dTotal = dFirstNum * dSecondNum
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(dTotal)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(dTotal)
            Case DECNUM
                OutputWindow.Text = dTotal
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(dTotal)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(dTotal)
        End Select
         
        dFirstNum = dTotal
        bFirstNum = True
        bEntered = True
        iMathFunction = 0
    Case PLUS
        dTotal = dFirstNum + dSecondNum
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(dTotal)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(dTotal)
            Case DECNUM
                OutputWindow.Text = dTotal
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(dTotal)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(dTotal)
        End Select
         
        dFirstNum = dTotal
        bFirstNum = True
        bEntered = True
        iMathFunction = 0
    Case MINUS
        dTotal = dFirstNum - dSecondNum
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(dTotal)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(dTotal)
            Case DECNUM
                OutputWindow.Text = dTotal
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(dTotal)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(dTotal)
        End Select
        xFirstNum = dTotal
        bFirstNum = True
        bEntered = True
        iMathFunction = 0
    Case POWER
        xTotal = 1
        If dSecondNum <> 0 Then
            For iCounter = 1 To dSecondNum
                dTotal = dTotal * dFirstNum
            Next
        End If
        Select Case iCurrentRadix
            Case ROMANNUM
                OutputWindow.Text = GetDecRomanStr(dTotal)
            Case HEXNUM
                OutputWindow.Text = GetDecHexStr(dTotal)
            Case DECNUM
                OutputWindow.Text = dTotal
            Case OCTNUM
                OutputWindow.Text = GetDecOctStr(dTotal)
            Case BINNUM
                OutputWindow.Text = GetDecBinStr(dTotal)
        End Select
        xFirstNum = dTotal
        bFirstNum = True
        bEntered = True
        iMathFunction = 0
    End Select
End Function
 
 
 
eray yel
erayyel@hotmail.com


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2025 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.