Saturday, March 21, 2020
Why American Troops Are Being Sent Overseas Essays -
Why American Troops are being Sent Overseas Why American Troops are being Sent Overseas American troops are being sent overseas to maintain peace in a nation involved in a civil war. Whether the peace troops should or should not be sent overseas, they are being sent overseas. I do not believe that it is the responsibility of American troops to make peace in a country that is at Civil war. A civil war is a war fought within a nation between that nations people. By sending peace troops to East Timor the United States is now becoming involved in this nations war. This could cause the United States to go to war. The arrival of multinational troops could bring more violence, destruction, and chaos to East Timor. On the other hand it could also bring protection to the many people who have fled the violence from the Indonesian Militia. Force should not have to be used to make or keep peace in any country; therefore it is not necessary for American troops to have to risk there lives trying to make peace in a country that won't make peace until they get what they want, INDEPENDENCE. Sending troops into Dili, East Timor may help persuade the people to make peace, but it is not necessary to send all of those troops. Just a few mediators would be sufficient to help make peace. If the nations at battle would just talk they might be able to negotiate a peace treaty and there would be cooperation without more violence. American troops would not be exposed to the violence either. The United States is a country known for helping other countries in there time of need, and the United States always plays a big role in every country, whatever the situation may be. East Timor is fighting for there independence. The United States should not send more troops to help the Dili militia fight, but send trained people who know how to persuade people to make peace. Then the United States would be setting a good example by not using violence, and would still be protecting the people. The role of the United States is very important, and the United States has quite an image to keep up. Sometimes the United States does not know what the right decision is, and until they try one of there choices they will not know what the right or wrong decision is. It is not the United States responsibility to make peace in a country at civil war. It is the nations' that are at war who are responsible for making peace in their country. Unless the United States is at war American troops should be able to stay at home with their families. If the United States believe that it is their responsibility to help in some way, than they should help. Even if the United States does send mediators to Indonesia and East Timor they are still becoming involved in that civil war, but they are not using violence, and will not cause any more deaths. The United States would still be protecting the people just by having them talk to each other, instead of the people using force and violence. Any problem can be resolved by talking about it in a mature manner, and no one will be hurt in the process. Someday, it may not be soon and we may not live to see it, but this world will be a Utopia, a perfect place for all. There will be no more fighting or violence, only love and peace. Until that day we must strive to make this world a better place for all generations to come.
Thursday, March 5, 2020
Handling Errors and Exceptions in Delphi Applications
Handling Errors and Exceptions in Delphi Applications Unfortunately, building applications includes coding. Regardless of how carefully you write/debug your program, it will be impossible to imagine every situation that can go wrong. The inexperienced user might, for example, try to open a nonexisting file or input a bad value into a data field.Users make mistakes and we should be prepared to handle/prevent these errors wherever and whenever possible. Errors, Exceptions? An exception is generally an error condition or another event that interrupts the normal flow of execution in an application. Whenever an error results from processing a line of code, Delphi creates (raises) an object descendant from TObject called the exception object. Guarded Blocks An application responds to an exception either by executing some termination code, handling the exception, or both. The way to enable error/exception trapping within a given code, the exception must occur within a guarded block of statements. The general code looks like: try à à {guarded block of code} except à à on do begin à à à à {exception block-handles SomeException} à à end; end; A try / except statement executes the statements in the guarded block of code. If the statements execute without any exceptions being raised, the exception block is ignored, and control is passed to the statement following the end keyword. Example: ... Zero:0; try à dummy: 10 / Zero; except à on EZeroDivide do à à à MessageDlg(Can not divide by zero!, à à à à à à à à à à à à à à à mtError, [mbOK], 0) ; end; ... Protecting Resources When a section of code acquires a resource, it is often necessary to ensure that the resource is released again (or you might get a memory leak), regardless of whether the code completes normally or is interrupted by an exception. In this case, the syntax uses finally keyword and looks like: {some code to allocate resources} try à à {guarded block of code} finally à à {termination blok - code to free resources} end; Example: ... AboutBox:TAboutBox.Create(nil) ; try à à AboutBox.ShowModal; finally à à AboutBox.Release; end; ... Application.OnException If your application doesnt handle the error that caused the exception, then Delphi will use its default exception handler - it will just pop up a message box. You may consider writing code in the OnException event for TApplication object, in order to trap errors at the application level. Break On Exceptions When building a program with exception handling, you may not want Delphi to break on Exceptions. This is a great feature if you want Delphi to show where an exception has occurred; however, it can be annoying when you test your own exception handling. Few final words The idea of this article is to give you just a quick look at what exceptions are. For further discussion on exception handling, consider On Handling Exceptions in Delphi Exception Handling, using a tool like Delphi Crash / Exception Handling with Bug Reporting and some of the following related articles:
Subscribe to:
Comments (Atom)