Saturday, January 25, 2020

Importance of Workforce Planning

Importance of Workforce Planning 1. To analyse the importance of workforce planning and explain the difficulties. Importance In its simplest terms workforce planning is getting the right number of people with the right skills, experiences, and competencies in the right jobs at the right time. This shorthand definition covers a comprehensive process that provides managers with a framework for making staffing decisions based on an organisations mission, strategic plan, budgetary resources, and a set of desired workforce competencies. This process is simple in outline but depends on rigorous and comprehensive analysis of the organisations work, workforce, and strategic direction. Workforce planning requires strong management leadership; clearly articulated vision, mission, and strategic objectives; and cooperative supportive efforts of staff in several functional areas. Strategic planning, budget, and human resources are key players in workforce planning. Organisation plans set organisational direction and articulate measurable programme goals and objectives. The budget process plans for the funding to achieve objectives. Human resources provides tools for identifying competencies needed in the workforce and for recruiting, developing, training, retraining, or placing employees to build the workforce of the future. Organisational success depends on having the right employees with the right competencies at the right time. Workforce planning provides managers the means of identifying the competencies needed in the workforce not only in the present, but also in the future and then selecting and developing that workforce. Finally, workforce planning allows organisations to address systematically issues that are driving workforce change. The overall benefits of workforce planning, then, are its ability to make managers and programmes more effective A workforce plan must document the workforce analysis, competency assessments, gap analysis, and workforce transition planning that makes up the planning process. These data provide the documentation of the inputs and comprise the basic output of the planning. This information establishes the validity of any workforce plan by demonstrating the links between workforce planning and programme management, budget justifications, Organisation goals, and human resources work planning. Workforce planning provides managers with a strategic basis for human resource management decision-making that is based on achieving programme goals. Forecasting models based on analysis of the workforce allow managers to anticipate turnover and to plan recruiting and employee development to move toward the workforce needed in the future which form a radar for continual monitoring. Difficulties in workforce planning Some of the problems with workforce planning relate to the incongruence of the process with the traditional HR function (Friel, 2002). Most HR leaders oversee established, routine work involving benefits, payroll processing and job classification. Time which could be spent doing strategic work is often eaten up by HR administration. In the US, some federal agencies such as the Internal Revenue Service, have attempted to counteract this problem by splitting the two sides of the HR function to create two departments (Friel, 2002). In the past workforce plans have been approved on the basis of personal credibility, not quantifiable metrics, which do not stand the test when organisations run into difficulties. Sullivan (2002b) recommends that organisations consider training their HR staff in the relevant skills and revisiting their performance management and bonus schemes so that they measure and reward workforce planning. Lack of Integration In practice, it is often done independently of other processes whilst there is a danger of exercising too much corporate power over different units (Sullivan, 2002d). Integration of Planning Processes In the past, the process of workforce planning was independent to other resource allocation activities such as budgeting and production planning. As a result, managers found themselves confronted with different and often contradictory forecasts (Sullivan, 2002d). A number of models of workforce planning propose that forecasting should begin with an appreciation of the future direction of the business. The importance of aligning strategic and workforce plans has been emphasised in academic research. There has long been the argument that HR practices that are consistent with or support organisational strategy are more effective than those that do not (eg Schuler Jackson, 1987). Whilst it is tempting to integrate local plans into a master workforce plan, Bechet (2000) stresses keeping them separate and not consolidated. This is because the process of consolidation sometimes squeezes out the very detail that is most useful and ends up masking significant differences between units. Lack of Ownership According to Sullivan (2002c), workforce planning has often been seen as something owned by the HR department, not by management. However, when times are tight, it is not HR who has the authority. This threatens the security of workforce planning since, without a real appreciation of its benefits, management may decide it is dispensable. Experience shows that ownership of any HR initiative needs to be extended to senior levels with a senior champion identified to help drive the process through. Lack of Flexibility The manpower planning strategies of the past worked according to straight-line growth and tried to define a single bulls-eye for a target (Sullivan, 2002d). Recent changes have shown that the business world often fails to follow historical patterns and that organisational plans need to be more flexible (Sullivan, 2002b). To be useful, Sullivan recommends that workforce planning includes a range of targets and that organisations prepare for all eventualities in that range. One means through which flexibility can be achieved is through scenario planning (see Reilly, 1996). Scenarios are not intended to be predictive. Rather they recognise that uncertainty is not just an occasional, temporary deviation from a reasonable predictability; it is a basic structural feature of the business environment. (Wack, 1985). Particularly as originally developed by Shell, their aim is to challenge assumptions of how the world works and to generate understanding of the important factors involved. Lack of Prioritisation In the past workforce plans have failed because they have been over-ambitious and have tried to achieve too much (Sullivan, 2002c). To be effective, Sullivan recommends that they be rightsized and aim to cover only those areas where they will have a significant impact. Workforce plans cannot possibly include everything so they should prioritise certain units, jobs, customers and products. Static Event Using Long Time-Frames In the past, workforce planning has used long time frames, sometimes looking ahead up to five or ten years. Often managers have refused to revisit plans more regularly because they take so long to develop (Sullivan, 2002d). Whilst an overview of the overall direction of the organisation requires a long-term focus, Sullivan recommends that detailed plans focus no more than 18 months ahead. Workforce planning should be seen as a living document (Reilly, 1996), something which is not static but needs to respond to changing circumstances. It is not an event (Bechet, 2000) but should be monitored regularly to avoid strategic drift (Johnson, 1987) where the match between the organisation and the external world disappears. Issues need to be defined on an ongoing basis and a discussion of the staffing implications of changes in business plans should be conducted each and every time change is discussed or anticipated. Bad Data and Analysis In the 1980s the amount and the quality of workforce-planningrelated information that was available to HR was minuscule by todays standards (Sullivan, 2002a). Without the ability to connect databases and analyse complex trends, HR planning was forced to guess, or all too commonly to utilise straight-line forecast. In addition, plans tended to be based purely on internal data without any consideration of what was going on outside (Sullivan, 2002d). Nowadays there are significantly better data and analysis techniques available (Sullivan, 2002a). The increased availability of economic and business data on the internet makes forecasting much easier and cheaper for even small firms. Access to enterprise-wide software packages now allows managers to easily collect data for forecasts and to prepare viable workforce plans. 2. To evaluate the significance of employee motivation and appraisal programmes in a business Importance of appraisal for employee motivation One of the secrets of a good performing company is the fact that they recognized the importance of staff motivation. Watch out for companies that are 10 years old and above, the secret of their sustenance and longevity lies on the above truth. A solid and good management doesnt joke with the above notion. The truth of the matter is this; for a staff to work efficiently and effectively, employees must be motivated. This means that their efforts should be rewarded with physical, financial and psychological benefits and incentives so that they could maintain a high level of morale, satisfaction, and productivity. It means that workers should be stimulated to take a desired course of action by providing them with the opportunities to gain what they want. Employee motivation is a function of all managers in general and of personnel managers in particular. The following are some of the techniques that can be used by a manager to motivate employees. Ensuring employee participation in the decision making process Paying adequate and fair remuneration to employees Praising employees for good works done Keeping employees in the know concerning changes in company policy Showing interest in workers and giving them adequate, personal attention Making the fullest use of employees skills, ideas, suggestions and abilities Giving employees helpful direction and assistance when they are in problem Making employees feel secure of their jobs and free from anxiety Setting good examples and exhibiting personal diligence Communicating standards to employees and making them know where they stand how well they are doing and what they can do to improve. The need to motivate employees is no longer hidden. What remains controversial is the best method of motivation. The rapid profusion and appearance of theories of motivation is a clear testimony to this. Peoples needs and situations vary. This implies that there can be no simple generalizations or one best method of motivation but rather a selective application of the techniques suggested above. Performance Appraisal of an employee Performance Appraisal is the regular, formalized and recorded review of the way in which an individual is performing his job. It is the evaluation of the performance of employees. According to Beach performance appraisal is the continuous systematic evaluation of the individual with respect to his performance on the job and his potential for development. Staff or performance appraisal is an integral part of every managers function. Indeed, whether intended or not, it occurs informally on a day-to-day basis in order to determine how to get work done and which members of staff to allocate to what duties. However, a formalized appraisal is a planned, systematic, methodical and comprehensive joint evaluation exercise by the appraiser ad the appraise. The extent of staff participation the degree of planning, and the purposes and priorities of appraisal systems vary from one organization to another. The main objectives of staff performance appraisal are as follows: To identify and reward competence and excellence To identify staff training needs and develop the potential of those employs who can satisfy different future manpower needs within the organizations. To identify performance deficiencies and spur improvements in them To motivate employees to be highly productive based on their knowledge of a forthcoming evaluation of their performance A planned and formalized performance appraisal scheme involves: (a) A definition of clear job objectives, targets and standards for each employee (b) An objective evaluation of staff performance and results against previously agreed standards. (c) An open discussion of the results and their implications (d) An agreement of committed plans for the future work of the appraise and the boss. The traditional method of appraising employees involves the annual filling of a standard appraisal form by the employees superiors. The form usually deals with various aspects of the employees work such as output level, co-operation with co-workers, ability to work independently, initiative, cost consciousness, goal orientation, etc. The performance of each employee in the year under review is then rated for each of these criteria using a numerical scale. For instance, if the scale is from 1 to 10, and employee might be scored 2/10 for output level, 3/10 for co-operation with co-workers, etc. The scores will then be summed together to determine whether the employee has performed well or not. In addition to the evaluation of a workers past performance, the superior might be asked to rate the workers potential for growth and advancement by stating that the worker is highly promising, average and may succeed with effort, unlikely to advance or a total write-off. To cap it all, the officer may be invited to make a general comment on the employee after which the form is sent to a higher hierarchy of management for consideration, comments and approval or rejection. To make an appraisal system a success, the following principles must be observed in its design and operation. It should be tailor-made to the specific nature and needs of the organization It should not be seen as an annual, ritualistic exercise, without any purpose, substance and significance. It should be objective and fair so that an employees performance ratings will not depend on who he or she knows in the organization. To achieve this, the exercise should involve more than just the appraisers immediate superior. The appraisers colleagues and subordinates should be brought into the picture. It should be standardized throughout the organization It should be based on specific goals or targets for improvements It should include some form of self-appraisal and should be based on open constructive discussion not broad praise or criticism. Subordinates should participate in setting the goals on which they will be appraised in the future. Superiors should not impose goals on their subordinates. Line managers must be trained in the techniques and methods of performance appraisal and must recognize and appreciate its contributions to organizational effectiveness. The scheme should be designed with just a few purposes. Appraisal systems designed to improve performance should not simultaneously consider wages, salary or promotion because the roles of judge and adviser are not complimentary and should therefore be separated. 3. Know the different schools of management thought that have been developed over the last Century CLASSIFICATION OF MANAGEMENT THEORIES As mentioned earlier, there are several schools of thought in management. Apart from the autocratic or authoritarian or pre-scientific era (i.e., earlier to 1880) of the early period, several schools of management thought are identified and classified in several ways by experts. It is interesting to note that while early writings on management principles came from experienced practitioners, the more recent writings tend to come from academic theorists, of whom have had no direct experience in organisational management. During the history of management a number of more or less separate schools of management thought have emerged, and each sees management from its own has classified the management theories into the following six groups: i) The management process school ii) The empirical school iii) The human behavioural school iv) The social systems school v) The decision theory school vi) The mathematical school. . Adding one more style or approach of his own Evans discusses eleven basic styles cited by Herbert Hicks in his books the management of organisations Again leaving the early perspectives, Hitt and others (1979) classify management theories into three broad groups. i) Classical management theory. ii) Neoclassical management theory iii) Modern management theory Under each group a few schools of thought are identified. These three groups of schools of management thought, are currently in vogue and found adequate for the purpose. CLASSICAL MANAGEMENT THEORY (1880s-1920s) Classical management theory consists of a group of similar ideas on the management of organisations that evolved in the late 19th century and early 20th century. The Classical school is sometimes called the traditional school of management among practitioners. This school, evolved as a result of the industrial revolution, in response to the growth of large organisations and in contrast to the handicraft system that existed till then. It contains three branches, namely, scientific management, administrative principles and bureaucratic organisation. The predominant and common characteristic to all three branches is the emphasis on the economic rationality of management and organisation The economic rationality of the individual employee at work assumes that people choose the course of action that maximises their economic reward. In other words, economic rationality assumes that people are motivated by economic incentives and that they make choices that yield the-greatest monetary benefit. Thus, to get employees to work hard, managers should appeal to their monetary desires. These assumptions are based on a pessimistic view of human nature. While they are true to some extent, they also overlook some optimistic aspects. Classical theorists recognised human emotions but felt that human emotions could be controlled by a logical and rational structuring of jobs and work. The primary contributions of the classical school of management includes (i) application of science to the practice of management (ii) development of the basic management functions and (iii) articulation and application of specific principles of management. NEO-CLASSICAL THEORY (1920s-1950s) The Traditional classical theory and its principles are attacked on the ground that they are contradictory, pay little attention to motivation, and make hasty pronouncements on what should be done, without examining the assumptions Management Perspectives underlying such pronouncements. As such, these principles do not represent the heart of knowledge of management but a small part of the total body of administrative management. As a reaction to schools of classical theory, which over emphasised the mechanical and physiological characters of management, came up the schools of neoclassical theory, with a more human-oriented approach and emphasis on the needs, drives, behaviours and attitudes of individuals. Another impetus was the development of the concepts of industrial psychology around the same time. Two important groups, namely, human relations school and behavioural schools emerged during 1920s and 1930s under the neoclassical theory. Names of two persons, often mentioned, from the period earlier to neoclassical theory, are Robert Owen and Andrew Ure. As Young Welsh factory owner, Robert Owen was first one to emphasise human needs of employees as early as 1800. Andrew Ike has incorporated human factors in his book `The Philosophy of Manufactures published in 1835. The human relations movement of the 1940s and the 1950s filled many gaps in knowledge about business organisations, but it did little to fill major gaps in management theory, or to create a new and viable theory of management. MODERN MANAGEMENT THEORY Modern management theory highlights, the complexity of the organisation as well as individuals and the diversity of their needs, motives, aspirations and potentials. As a result, one time status or universal management principles are impracticable. The complexities require intricate managerial strategies for dealing with people and organisation. As against the rational economic man of the classical theory and the social person view of neoclassical theory, the complex employee view is the premises of modem management theory. The complex employee view holds that people are both complex and variable. They have many motives, learn new motives through experience and motives vary from organisation to organisation and department to department. Complex interactions relate the employee and the organisation. There is no single managerial strategy that works for all people at all times. Managers can employ different strategies at different times and for different persons. Analytical tools may b e useful while applying managerial strategies. Four important modern management theories arising out of the complex employee view, are systems theory, contingency theory, organisational humanism, and management science. This stage of management theory represents the work of revisionist researchers combining streams of efforts in the behavioural sciences with those in mathematics, statistics, and the use of computers. Naturally many revisionists are behavioural scientists whose research extended beyond the human relations area. It is the powerful combination of systems theorists, operations research specialists, decision theorists, statisticians, computer experts, and others skilled in quantitative research and decision methods. Rigorous research and testing of propositions, using behavioural, statistical and mathematical tools, characterised this school of thought. This period is also called synthesis period. As against the predominantly engineering-oriented quantitative theorists in classical theory, industrial psychologists together with sociologists and applied anthropologists who dominated the neoclassical theory, it is the revisionist researchers, who dominated the modern management theory and questioned old tenets, developed new hypotheses, and offered better explanations of organisational and managerial behaviour. The revisionist movement appears to have begun with Litchfields propositions published in the first issue of Administrative Science Quarterly in 1956. They questioned principles developed by deductive reasoning in classical theory but did not discard all of the early theories. A logical extension of application of management knowledge into non-business areas such as education, government and health, is a significant contribution of the modem management theory. It is interesting to note that the classical theory was organisation centered with emphasis on efficiency having process or functional approach, based on deductive evidence and descriptive research. Neoclassical theory had the person-centered approach, was increasingly experimental, and almost remained descriptive and highly deductive. On the other hand, revisionists used behavioural and quantitative tools and remained more inductive, experimental, rigorous and complete. According to the modern management school, management is an exercise in logic and applies itself to situations, that can be reduced to unitised measurements and handled with quantitative methods, where computers have an increasing role to play. 4. Understand the problems of introducing and implementing change in todays workforce Implementation of a new idea is a more difficult task rather than just proposing it. This is especially true in organizations where putting in place a new practice requires many peoples understanding, agreement, and willingness to act. To implement one needs to convince peoples minds and hearts. It requires complete planning and documentation as its a switch of an organization from an existing practiced system to a new one. Planning the necessary political moves of the implementation requires willful and deliberate planning to capture the potentially dangerous organizational forces in change and use them to the changing organizations advantage system.. The planning and documentation of the new system includes not just the listing of the steps which are to be followed but also designing the work that can help people understand the new setup (Wick, 2005). TRANSITION OR IMPLEMENTATION PLAN The transition or implementation plan provides a bridge from the way things are carried out currently to the change you want in the organization. Making a detailed plan of transition is the only way for the change to take place completely and leads to desired future. E-mailing change or verbally ordering things to change wont make a new idea happen permanently. There are four stages of the plan Current state, Transition state, Future desired state and Clean up (Wick, 2005). If new things are not planned before hand and are implemented and practiced instantly then it will directly lead to clean up- a faux new state. In such condition the elements of the new and former system are combined hap- hazardly with a few future concepts and people spend most of their organizational time trying to clean up the impromptu mess. This will lead to confusion and chaos in the organization. Failed implementations can be avoided in the organization by expert construction and maintenance of your implementation plan (Wick, 2005). The need of organizational change arises due to environmental forces and conditions. For the survival of an organization, it must be fully capable of planning and handling the change (Smith E. and Jones D., 1996). A good manger effectively deals with the changes affecting the work environment and take measures to ensure continued growth and success of the organization (Doe, 1996). The objective of this paper is to identify and analyze an organizational problem, and to describe the implementation of a change to solve the problem using a change theory. IDENTIFICATION OF A PROBLEM The dissatisfaction expressed by employees in the work setting is often the first indication of a problem (B.Moore, 1997). Sharp managers constantly keep a watch on their work environment and are especially concerned for employee complaints that repeatedly occur (Doe S., 1996). The awareness and knowledge of a manger about the organizations work environment and its issues problems help him identify and solve the problem at an early stage before they become bigger issues. The engineering department employees of XYZ plant are unhappy with the required use of time clock to document their workday. An informal telephonic survey conducted of eight businesses revealed several methods for documenting and recording time worked. The most frequently used method allowed professionals to account for their time by submitting the number of days worked to the Payroll Department at the end of each pay period. A group of engineering department employees submitted a proposal to the manger for consideration of survey results and a trial implementation of a new method for documenting time worked. The manager has receivedconsent of the administration to review the proposal and submit his recommendations to the Chief Executive Officer within the next two weeks (Smith, 1999). IDENTIFICATION OF A CHANGE THEORY The Kurt Lewins theory of planned change is used as a model for implementing change in organization. The three phases identified in Lewins change process include unfreezing, moving or changing, and refreezing. The organization can overcome obstacles and bring about effective change by using this model (Hall, 1997). APPLICATION OF THE CHANGE PROCESS The change at the XYZ plant could ideally be implemented by using Lewins model. This change model has widely been used as it (a) can be applied to any setting, (b) is easy to follow, and (c) incorporates strategies to identify and resolve obstacles during the change process (B.Moore, 1997). The model will be used to describe the trial implementation of the honor system method for employees in the Engineering Department to document their time worked. The Lewins model proposes changes that are relatively straightforward and affects small number of employees within the organization (Hall, 1997). UNFREEZING The identification of a need for change and the establishment of a receptive climate is the first step of the change process. To unfreeze the environment, one has to follow the strategy of identifying obstacles in the way of successful change, communicating with employees of the department about the problem and its solution and outlining the benefits associated with the new change. In this way, the employees will support the proposed change, but more work is required to convince the administration (Hall, 1997). MOVING OR CHANGING Change is the second phase of the process. This involves the implementation of new setup, ideas, values, or behaviors that focus and leads to the actual change. For the XYZ Plant, the strategy might include clearly defined details about the new policy for documenting time worked, managing resistance to the change, development of a written procedure for the change, and a way to aware all employees when the change will take place. The recommendation to the Chief Executive Officer comprises of all these details, and formally developed if the trial period is successful (Hall, 1997). REFREEZING The third phase involves refreezing new behavior patterns into place. In this phase the reinforcement of the adopted change is strategically done until it is integrated. Incentives are given and some other motivators can be used to encourage the employees and to increase the acceptability and likelihood of the new setup. The engineers would be motivated by recognizing their professional status. The management would be incented by the decreased costs due to simplified record keeping (Hall, 1997). Several sources support Lewins change model as an effective tool for implementing planned organizational change (Hall, 1997; International Business Institute, 1998). Here, it was used to illustrate the implementation of an organizational change in response to a problem occurred in engineering department XYZ Plant. Though change is unavoidable but yet it can produce utter confusion in a work environment if it is not managed effectively.

Friday, January 17, 2020

Spanish vs. Ottomans

When empires expand, they all have a plan in mind on how and why they want to expand. It can differ from religious, wealth, or power reasons. It can also be with areas surrounding them or land far away. Simultaneously, empires can use similar military techniques, ways of keeping people in order, or ways of keeping up the economy. During the time of 1450 to 1800, the Spanish Empire and the Ottoman Empire responded to their empire building similarly in the idea that spreading their religion was their first focus, while there were differences in their social and economic values because their regions required them to be that way.The Spanish and the Portuguese originally originate from the Iberian Peninsula where Christianity was popular. In an attempt to expand, the Spanish sought after America. They look at it as a land they could conquest and convert over to Christianity. The Ottoman Empire, who was originally Turkish rising in the areas of Anatolia and the Balkans, was founded under t he religion of Islam. The sole purpose was to take Islam further. However, when they expanded it wasn’t like a monarch anymore but the sultans just handed power over to warriors.That way they could spend time adding more people to the empire instead of just fixing the government. The Spanish, on the other hand, were more hands on. They created institutions, taxed the natives, and had forced labor going on. Their focus was geared toward making their empire stable enough that they could conquer more natives, not having to worry about the government. The main difference was that the Spanish were more hands on while the Ottoman’s concern shifted to status. Around the late Eighteenth century early Nineteenth century is when hierarchy became a major issue for Spanish while the Ottomans fell into place.For both, the ruling class, the Europeans for Spanish and the sultans for the Ottomans, was at the top of the hierarchy. Beneath there is where both empires differ. The Ottoman s had merchants and artisans beneath the sultans which was very uncommon. However, they gave much of the contribution of the arts for the Ottomans. They are the cause of shops being opened and public works being done that wouldn’t have been complete otherwise. On the other hand, the Spanish was more focused on your race and gender while still giving reference to your job.Whites were at the top having the dominant roles, mixed races such as mestizo and mulatto in the middle, and black people at the bottom. Their structure was made so that Europeans would constantly rule and that slaves could only do their job: work. That way no matter how many people were added on they’d have the foundation that the empire can build off of. Lastly, the Spanish and Ottomans focus on building the economy had two different focuses. While the Spanish were concerned with silver, gold, and sugar, the Ottomans were focused on expansion.When landing on Peru, the Spanish quickly created silver m ine. That led to labor work of people of lower class. This way the Spanish has a wide rule of people that can continue to grow the mining industry as long as they continue to bring in slaves. Granted that that system worked, the Spanish could now export silver in exchange for goods. It’s in Brazil where they got the sugar to exchange for slaves that continued to make their population increase. On the contrary, the Ottomans wanted warriors in charge. Under their control war and taking of nearby territory became focus.Janissaries, a group of an Ottoman army, got an increase in weapons which soon led them to dominating a lot of territory. Equally, both the Spanish and Ottomans went after an area they thought would be beneficial in growing. Ultimately, the Spanish and Ottomans had similar foundations while still being different. Both grew tremendously in their own way under their own religion. However, the empires ended because they were too focused on one area of the empire but not another. The Ottomans was with war and the Spanish with money. The important part was that both left a legacy behind.

Thursday, January 9, 2020

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:

Wednesday, January 1, 2020

Descriptive Essay Tick, Tock - 1580 Words

Tick, Tock. It was nine o’clock and was getting ready for bed I felt like I was forgetting something. I curled up in bed and turned out the light†¦ Tick Tock†¦ â€Å"MY HOMEWORK!† I sprinted downstairs with my backpack flinging behind. I jumped into my hard chair in the small office that was built a year ago. I wrote so fast my hand cramped. All of a sudden the room started to shake papers flew around and I sat there still not sure what was happening. My heart stopped as my chair slowly rose up and I followed along with it. â€Å"Uhh MOM!† I screamed†¦ no reply.† Mom? â€Å" I said I knew she wasn’t home. Something caught my eye†¦ WATER! But I didn’t realize the drink me sign approached on the side†¦ I closed my eyes hoping that this all was a dream and took a sip. â€Å"OW!† Something or someone pinched me as I opened my eyes to see a small creature standing in front of me. â€Å"Hi!† The small creatur e said with a grin on its face. â€Å"GET AWAY FROM ME!† I screamed. I ran not knowing where I was. Hills of green surrounded me with weird shaped trees that had huts in them. I tried to find someone to help me get home. I climbed a small narrow passage that lead to something I couldn’t explain, a small hut burrowed under a small hill filled with white bunnies. â€Å"Knock Knock.† My hand hit the door hard and down came shattered†¦ nuts? â€Å"Um Hello?† I exclaimed hoping someone could help me I rushed through the hut hoping someone was there. All around me was something unusual, the couches were filled with peanut