Friday, May 22, 2020

How Delphi Uses Resource Files

From bitmaps to icons to cursors to string tables, every Windows program uses resources.  Resources  are those elements of a program that support the program but are not executable code. In this article, we will walk through some examples of the use of bitmaps, icons, and cursors from resources. Location of Resources Placing resources in the .exe file has two main  advantages: The resources can be accessed more quickly because it takes less time to locate a resource in the executable file than it does to load it from a disk file.The program file and resources can be contained in a single unit (the .exe file) without the need for a lot of supporting files. The Image Editor First of  all, we need to create a resource file. The default extension for resource files is  .RES. Resource files can be created with  Delphis Image Editor. You can name the resource file anything you want, as long as it has the extension .RES and the filename without the extension is not the same as any unit or project filename. This is important, because, by default, each Delphi project that compiles into an application has a resource file with the same name as the project file, but with the extension .RES. Its best to save the file to the same directory as your project file. Including Resources in Applications In order to access our own resource file, we have to tell Delphi to link our resource file in with our application. This is accomplished by adding a compiler directive to the source code. This directive needs to immediately follow the form directive, like the following: {$R *.DFM} {$R DPABOUT.RES} Do not accidentally erase {$R *.DFM} part, as this is the line of code that tells Delphi to link in the forms visual part. When you choose bitmaps for speed buttons, Image components or Button components, Delphi includes the bitmap file you chose as part of the forms resource. Delphi isolates your user interface elements into the .DFM file. To actually use the resource, you must make a few Windows API calls. Bitmaps, cursors, and icons stored in RES files can be retrieved by using the API functions LoadBitmap, LoadCursor, and LoadIcon respectively. Pictures in Resources The first example shows how to load a bitmap stored as a resource and display it in a TImage component. procedure TfrMain.btnCanvasPic(Sender: TObject);var bBitmap : TBitmap;begin bBitmap : TBitmap.Create; try bBitmap.Handle : LoadBitmap(hInstance, ATHENA); Image1.Width : bBitmap.Width; Image1.Height : bBitmap.Height; Image1.Canvas.Draw(0,0,bBitmap); finally bBitmap.Free; end;end; Note: If the bitmap that is to be loaded is not in the resource file, the program will still run, it just wont display the bitmap. This situation can be avoided by testing to see if the  bBitmap.Handle  is zero after a call to  LoadBitmap()  and taking the appropriate steps. The  try/finally  part in the previous code doesnt solve this problem, it is just here to make sure that the bBitmap is destroyed and its associated memory is freed. Another way we can use to display a bitmap from a  resource is as follows: procedure TfrMain.btnLoadPicClick(Sender: TObject);begin Image1.Picture.Bitmap. LoadFromResourceName(hInstance,EARTH);end; Cursors in Resources Screen.Cursors[]  is an array of cursors supplied by Delphi. By using resource files, we can add custom cursors to the Cursors property. Unless we wish to replace any of the  defaults, the best strategy is to use cursor numbers starting from 1. procedure TfrMain.btnUseCursorClick(Sender: TObject); const NewCursor 1;begin Screen.Cursors[NewCursor] : LoadCursor(hInstance,CURHAND); Image1.Cursor : NewCursor;end; Icons in Resources If we look at Delphis  Project-Options-Application  settings, we can find that Delphi supplies the default icon for a project. This icon represents the application in the Windows Explorer and when the application is minimized. We can easily change this by clicking the Load Icon button. If we want, for example, to animate the programs icon when the program is minimized, then the following code will do the job. For the animation, we need a  TTimer  component on a form. The code loads two icons from resource file into an array of  TIcon  objects; this array needs to be declared in the public part of the main form. Well also need  NrIco, that is an Integer type variable, declared in the  public  part. The  NrIco  is used to keep track of the next icon to show. public nrIco : Integer; MinIcon : array[0..1] of TIcon;...procedure TfrMain.FormCreate(Sender: TObject);begin MinIcon[0]:TIcon.Create; MinIcon[1]:TIcon.Create; MinIcon[0].Handle:LoadIcon(hInstance,ICOOK); MinIcon[1].Handle:LoadIcon(hInstance,ICOFOLD); NrIco:0; Timer1.Interval:200;end;...procedure TfrMain.Timer1Timer(Sender: TObject);beginif IsIconic(Application.Handle) then begin NrIco:(NrIco1) mod 2; Application.Icon:MinIcon[NrIco]; end;end;...procedure TfrMain.FormDestroy(Sender: TObject);begin MinIcon[0].Free; MinIcon[1].Free;end; In the Timer1.OnTimer event handler, IsMinimized function is used to see whether we need to animate our main icon or not. A better way of accomplishing this would be to capture the maximize/minimize buttons and than act. Final Words We can place anything (well, not everything) in resource files. This article has shown you how to use resources to use/display bitmap, cursor or an icon in your Delphi application. Note: When we save a Delphi project to the disk, Delphi automatically creates one .RES file that has the same name as the project (if nothing else, the main icon of the project is inside). Although we can alter this resource file, this is not advisable.

Sunday, May 10, 2020

Essay about Andrew Jackson, an Ideal President for America

Andrew Jackson, seventh president of the United States of America, can be debated as either a good president or bad president. But if one were to weigh out the positives and negatives of Andrew Jackson’s presidency, one would realize that his positives outweigh his negatives for a variety of historic facts. Andrew Jackson was a good president because he represented the majority of America’s people by being a common, prevented a civil war when South Carolina threatened to secede from the nation, and because he technically found or instigated the two major parties used in America today (Democratic and Republican). Many Jackson oppositionists despise him because of he is a hypocrite, however America was founded on hypocrisy so as an†¦show more content†¦Jackson is very important because he created or instigated the two dominant political parties we use today (democratic and republican). The beliefs in these parties switched several times in history but initial ly Jackson was a democrat. The major beliefs in democrats in the 1820s-1850s were the beliefs in a small national government, pro states’ rights, and a strict interpretation of the constitution. The republicans (initially known as the Whigs) essentially opposed all of Jackson’s beliefs and therefore had more or less the complete opposite beliefs of the democrats. By starting these two political parties, he started the way people would categorize political candidates throughout the rest of American history. There are many who are against Andrew Jackson because he is a hypocrite. An example of this is how Jackson states he is against slavery but still owned slaves. One has to understand that America was founded on hypocrisy. Essentially what Jackson is trying to do is to make compromises on situations so he can support both sides of an argument to represent as many people as possible. Conclusively Jackson was a great president because he represented the people of A merica by being a common man, overcame huge obstacles such as keeping South Carolina from seceding, and by forming the two most popular political parties used in America today, the Democrats and the Republicans. Those who argue that Jackson was a bad president simplyShow MoreRelatedAccelerated US History911 Words   |  4 PagesAccelerated US History I In the Presidential Election of 1824, Andrew Jackson – the â€Å"people’s choice† – lost the ballot by way of a â€Å"corrupt bargain† in the House of Representatives. Four years later and with the backing of a larger political following, Jackson became president, campaigning to the middle class and offering the opportunities of a benevolent democracy. Jackson’s supporters, the Jacksonians, were as diverse as they were numerous; northern farmers, southern and western yeomen, andRead MoreHow Democratic Was Andrew Jackson?1265 Words   |  6 Pages How Democratic Was Andrew Jackson? Looking at the ballots of 1828 and 1832, Andrew Jackson was clearly labeled as a Democratic Republic, a party founded by Thomas Jefferson. These Democrats supposedly believed in the ideas of a limited central government, states’ rights, and protection of the liberty of individuals. However, based on these principles, tyrannous â€Å"King Andrew I† may not be as democratic as one may think. Jackson shifted the Presidency to a more personal styleRead MoreAndrew Jacksons Views Of Jacksonian Democracy1157 Words   |  5 PagesJacksonian Democracy describes the time from when Andrew Jackson became the seventh president of the United States in 1829 till the end of his second term in 1837 (Shi and Tindall, 319). He was the first president that didn’t come from a prominent colonial family. His â€Å"common man† background lead him to being a popular political figure among the common people. This lead to him and his supporters forming America’s democrati c party. A democracy is a system of government where the people or citizensRead MoreEssay on President Jackson on the Twenty Dollar Bill650 Words   |  3 PagesJackson on the Twenty Dollar Bill Taylor Alton, 7th 11/13/11 I do not believe that President Jackson should be on the twenty dollar bill. He was not a man of good; all he cared about was pleasingRead MoreOn March 28, 1834, A Storm Arrived The United States Took1673 Words   |  7 Pagesignore. Through, this single message these lawmakers wanted to send a message to the President of the United States or ‘Caesar’ as some were calling him, he had gone too far. This thing that required ten weeks of the Senate’s attention would not change anything but simply to scold the President. But, they drafted and debated this for weeks and finally by a vote of 26 to 20 it passed it read, â€Å"Resolved. That the President†¦ has assumed upon himself authority and power not conferred by the constitution andRead MoreManifest Destiny : Ideal Or Justification Essay883 Words   |  4 PagesManifest destiny: Ideal or Justification The Louisiana Purchase doubled the size of U.S in 1803. But it is not enough for ambitious Americans, we are not satisfied, we wanted more territory. So western expansion did not end, it actually keep moved. Westward Expansion is a very significant part in U.S history. It operated perfectly based on the ideology called manifest destiny. However, the creation of this theory is on purpose. It was used to push U.S territory to further west. When the idea of manifestRead More Jacksonian Era Essay721 Words   |  3 Pagesâ€Å"Age of Jackson† wasn’t a time era, which brought forth a great political, social, or economic freedom and equality to the U.S., it did in fact put our country through a metamorphosis in our political lives of the nation. The start of a new presidency (Jackson’s presidency) was accompanied by huge numbers of Hickoryites (Jacksonian supporters) and official hopefuls. Many of these hopefuls were granted their desire of holding office, which is one of the changes brought into Washington by Andrew JacksonRead MoreAndrew Jackson Short Biography1610 Words   |  7 PagesAndrew Jackson was the most loved yet most hated president in history. Jackson was the seventh President of the United States and one of the most controversial presidents our country has ever experienced. In fact, Thomas Jefferson once wrote, â€Å"I feel very much alarmed at the prospect of seeing General Jackson pr esident. He is one of the most unfit men I know of for the place†¦He is a dangerous man.† This is how a backwoods boy became the face of the people when the American people needed it most whileRead MoreThe Evolution Of Democracy In The Early Republic. The Evolution1206 Words   |  5 Pagesevolution of democracy from the time of President Thomas Jefferson to President Andrew Jackson can be depicted as a minimal change in conceptually agrarian viewpoints and strong supporters of equality for the common man. While the two men essentially shared many of the same beliefs and ideas, there was a noticeable difference to how they acted on them and spoke out about them. As the nation s third president, Jefferson organized the national government by his own ideals, doubled the size of the United StatesRead More Andrew Jackson Essay981 Words   |  4 PagesAndrew Jackson No one can argue that as a president, Jackson made no mistakes; however, they in no way disqualify him from having a place on the U.S. twenty dollar bill. Jackson made every decision according to the will of the American people, even the more unsavory ones. He was a war hero that exemplified the strength and tenacity by which America has defined itself over the generations. He acted in all ways with concern for the growth of the American nation, both at home and overseas. Even his

Wednesday, May 6, 2020

Ways to Fix Run Ons Fragments Free Essays

Understanding sentence structure helps in identifying and correcting run-on sentences and sentence fragments. A computer’s spell checker does not typically catch these common mistakes, so do not rely on the spell checker to correct grammar for you. Be sure to carefully proofread all assignments for these issues. We will write a custom essay sample on Ways to Fix Run Ons Fragments or any similar topic only for you Order Now This handout defines various sentence structures, presents sample sentences, and provides strategies for correcting run-ons, comma splices, and fragments. Practice activities are included to help build skills in sentence clarity and variety. First, consider the parts of a complete sentence: Complete Sentence (Independent Clause) Table of Contents Part I: Run-ons †¢ Strategies for avoiding run-ons (comma splices and fused sentences) (p. 2-3) †¢ Sample sentences with explanations, practice activities (with answer key) (p. 4-7) Part II: Fragments †¢ Strategies for avoiding sentence fragments (p. 8-11) †¢ Sample sentences with explanations, practice activities (with answer key) (p. 12-13) Part I: Run-On Sentences Definition: A run-on sentence either has too many independent clauses or two independent clauses that are not linked correctly. Two types of run-on sentences are fused sentences and comma splices. Strategies for Correcting Fused Sentences: 1. Create a compound sentence. Inserting a coordinating conjunction (for, and, nor, but, or, yet, so) plus a comma correctly links these independent clauses. This sentence structure is called a compound sentence. Correct compound sentence: She writes the music, and he plays the guitar. independent clause + comma + coordinating conjunction + independent clause 2. Separate independent clauses with periods and capitalization, creating simple sentences. Correct sentences: She writes the music. He plays the guitar. 3. Insert a semi-colon. Semi-colons should be used sparingly and to connect independent clauses whose meanings are closely related. Correct sentence: She writes the music for Coldplay; he plays the guitar for that band. * Note: When more details are added to the above independent clauses, the meanings become much more closely related. Thus, a semi-colon can separate these clauses. 4. Link ideas using a subordinate clause (dependent clause). Correct Sentence: While she writes the music for Coldplay, he plays the guitar for that band. ubordinate clause + comma + independent clause ‘While’ is a subordinating conjunction, which makes ‘while she writes music for Coldplay,’ a dependent clause. That is, the clause depends on the rest of the sentence for the overall meaning to be clear. A dependent clause cannot stand alone. Use a comma to separate a dependent clause that appears before an independent cla use. *Note: A sentence constructed of one independent clause and one or more dependent (or subordinate) clauses is called a complex sentence. Strategies for Correcting Comma Splices: . Insert a coordinating conjunction to create a compound sentence. Correct Sentences: She writes the music for Coldplay, but he plays the guitar for that band. She writes the music for Coldplay, and he plays the guitar for that band. Remember, the coordinating conjunction appears after the comma. *Note: Again, consider meaning before joining sentences. If the sentences are not closely connected, it may be best to keep them separate. Think about these two independent clauses: Today I was late for class. I will have a burrito for dinner tonight. Since these ideas are distinct, keep the sentences separate. 2. Insert a semi-colon. Correct Sentence: She writes the music for Coldplay; he plays the guitar for that band. Again, to join two independent clauses with a semi-colon, be sure that their meanings are closely connected. The Tutoring Center has a separate handout on semi-colon usage. * See pages 4-7 for further explanation of these strategies as well as sample sentences and practice activities. Run-On Sentences: Examples and Explanations Examples: It was raining Naomi could not find her umbrella. (Fused) It was raining, Naomi could not find her umbrella. (Comma Splice) How to fix these run-ons: Step 1: Identify the independent clauses. It was raining + Naomi could not find her umbrella. subject + verb phrase subject + verb phrase (direct object) Step 2: Use one of the below strategies. 1. Period + Capital Letter (Separate Sentences) It was raining. Naomi could not find her umbrella. S + V. S +V 2. Comma + Coordinating Conjunction (Compound Sentence) It was raining, and Naomi could not find her umbrella. S + V , and S + V . Semi-Colon It was raining; Naomi could not find her umbrella. S + V ; S + V 4. Subordinating Conjunction + Comma (Complex Sentence) Though it was raining, Naomi could not find her umbrella. dependent clause, S + V *Note: Use the Tutoring Center’s Transitions/Grammar Aid Handout to help identify coordinating and subordinating conjunctions. Ask a tutor if you are unclear about the meanings of these conjunctions or in which situations to use them. Practice: Avo iding Run-Ons Correct the following run-on sentences by using the strategies previously discussed. 1. I moved to the United States when I was young it was easy to learn English, my parents were already here, they knew English already. ___________________________________________________________________________________________________________________________________________________________________________ 2. Juan and David recognized each other they had been in the first grade together. ___________________________________________________________________________________________________________________________________________________________________________ 3. Her car would not start she was late for class. ____________________________________________________________________________ ______________________________________________________________________________________________ 4. The parents ate the baby slept in her stroller. ____________________________________________________________________________________________________________________________________________________________________ _______ 5. Eli wants to quit smoking this habit is too expensive. ___________________________________________________________________________________________________________________________________________________________________________ Avoiding Run-Ons: Answer Key and Explanations 1. I moved to the United States when I was young it was easy to learn English, my parents were already here, they knew English. Strategy 1: Period + Capital Letter (Separate Sentences) I moved to the United States when I was young. S + V (prepositional phrase) (dependent clause) It was easy to learn English. S + V (adverb phrase) My parents were already here. They knew English. S + V (adverb phrase). S + V (direct object) Strategy 2: Coordinating Conjunction + Comma (Compound Sentence) I moved to the United States when I was young, and it was easy to learn English. S + V , and S + V My parents were already here, so they knew English. S + V , so S + V Strategy 3: Semi-Colon I moved to the United States when I was young; it was easy to learn English. S + V ; S + V My parents were already here; they knew English. S + V ; S + V Strategy 4: Subordination (Complex Sentence) Because I moved to the United States when I was young, it was easy to learn English. (dependent clause) + , S + V Because is a subordinating conjunction that makes the first clause dependent on the second clause. Do not use a coordinating conjunction to link a dependent clause and an independent clause; rather, use only a comma. For example: Since my parents were already here, they knew English. Note: This run-on sentence can also be corrected using a combination of the above strategies. I moved to the United States when I was young, so it was easy to learn English. (compound sentence) Because my parents were already here, they knew English. (complex sentence) More suggested answers: 2. Juan and David recognized each other; they had been in the first grade together. S + V ; S + V (prepositional phrase) Juan and David recognized each other, for they had been in the first grade together. S + V , for S + V Since they had been in the first grade together, Juan and David recognized each other. Since + dependent clause , S + V Juan and David recognized each other. They had been in the first grade together. S + V. S + V Now it’s starting to make sense: 3. Her car would not start, so she was late for class. Her car would not start, and she was late for class. Her car would not start. She was late for class. Because her car would not start, she was late for class. Her car would not start; she was late for class. (correct, but not the best choice) 4. While the parents ate, the baby slept in her stroller. The parents ate as the baby slept in her stroller. The parents ate. The baby slept in her stroller. The parents ate, and the baby slept in her stroller. The parents ate; the baby slept in her stroller. 5. Eli wants to quit smoking. This habit is too expensive. Eli wants to quit smoking; this habit is too expensive. Eli wants to quit smoking, for this habit is too expensive. Since this habit is too expensive, Eli wants to quit smoking. A more logical, concise construction using subordination would read as follows: Since smoking is too expensive, Eli wants to quit. Part II: Sentence Fragments There are several types of fragments. See pages 9-11 for detailed explanations and techniques for correcting fragments. Pages 12-13 include practice activities and an answer key. Types of Fragments Each example below illustrates a different type of sentence fragment. Any fragment can be corrected by linking the fragment to an independent clause—one which comes before or after it and which makes sense within the paragraph. Examples of Subordinating Conjunctions and Relative Pronouns |after |how |unless |whichever | |although |if |until |while | |as |in order that/to |what |whether | |as if |once whatever |who | |as soon as |rather than |when |whoever | |as though |since |whenever |whom | |because |so that |where |whomever | |before |than |whereas |whose | |even if |that |wherever |why | |even though |though |which | | Strategies for correcting subordinating conjunction and relative pronoun fragments: 1. Connect the fragment to the sentence that comes before or after it. Correct Sentences: While I was waiting for my car to be repaired, I read a magazine. dependent clause , S + V Notice the use of the comma after the dependent clause (because the dependent clause falls at the beginning of the sentence). I had to ride the bus while I was waiting for my car to be repaired. S + V dependent phrase *Note: When a dependent (subordinate) clause comes after the independent clause, it is usually unnecessary to place a comma after that independent clause. Whether or not a comma is needed depends on the meaning of the sentence. 2. Remove the subordinating conjunction/relative pronoun. Correct sentence: I was waiting for my car to be repaired. S + V Strategies for correcting â€Å"ing† fragments: 1. Connect the fragment to the sentence that comes before or after it. Correct sentences: Her expertise being in chemistry and biology, she was not hired as an English instructor. ependent –ing phrase , S + V She designed the new science exhibit, her expertise being in chemistry and biology. S + V , dependent –ing phrase 2. Correct the verb form. Correct sentences: Her expertise is in chemistry and biology. Her expertise was in chemistry and biology. *Note: Sometimes you will also need to add a subject and correct the verb form. See the next page for an example. . Strategies for correcting missing subject fragments: 1. Connect the fragment to the sentence that comes before or after it. Correct Sentences: Security set off the alarm, evacuated the building, and closed ll the entrances. In the above sentence, it is clear that the subject, the doer of the actions, is security. 2. Add the missing subject. Correct Sentence: Security set off the alarm and evacuated the building. Next, they closed all the entrances. *Note: In this sentence, the pronoun ‘they’ renames the subject, security. Transition Words Indicating a List or Examples |also |especially |except |for instance |including | |in addition |furthermore |for example |such as |next | Strategies for correcting â€Å"extra information† fragments: 1. Connect the fragment to the sentence that comes before or after it. Correct sentence: Many Americans take basic amenities for granted, for example, clean water and electricity. S + V , dependent phrase 2. Add the missing subject and verb. Correct sentence: For example, basic amenities include clean water and electricity. transitional phrase, S + V Practice: Avoiding Fragments Correct these sentences using the strategies previously discussed. 1. The dog loved his new toys. Especially the ones that squeaked. __________________________________________________________________________________________________________________________________________________________________________ 2. Maggie remembered her childhood. Her mother making pancakes for dinner in the small apartment. ________________________________________________________________________________________________________________________________________________ ___________________________ 3. She decided to meet her new friend in a public place. That they had arranged over e-mail. ___________________________________________________________________________________________________________________________________________________________________________ 4. Because she met him on MySpace. She thought it was a good idea to be cautious. __________________________________________________________________________________________________________________________________________________________________________ 5. I cannot wait until President’s Day. Finally, a day off. ___________________________________________________________________________________________________________________________________________________________ ________________ Avoiding Fragments: Answers and Explanations 1. The dog loved his new toys, especially the ones that squeaked. S + V , dependent clause The dog loved his new toys. He especially loved the ones that squeaked. S + V. S + V 2. Maggie remembered her childhood, especially her mother making pancakes for dinner in the S + V, dependent clause small apartment. Maggie remembered her childhood. Her mother made pancakes in the small apartment. S + V. S + V (correct form) 3. She decided to meet her new friend in a public place that they had arranged over email. S + V dependent clause She decided to meet her new friend in a public place. They had arranged a place over email. S + V. S + V 4. Because she met him on MySpace, she thought it was a good idea to be cautious. dependent clause, S + V She thought it was a good idea to be cautious; she met him on MySpace. S + V ; S+ V 5. I cannot wait until President’s Day, finally, a day off. S +V, dependent phrase I cannot wait until President’s Day. Finally, we have a day off. S + V. S + V ———————– Avoiding Run-On Sentences, Comma Splices, and Fragments A complete sentence has (minimally) two parts, a subject and a verb. A sentence must also express a complete thought. Such a phrase consisting of a subject and a verb (with complete meaning) is also called an independent clause. Example: He writes music. This sentence has a subject and verb. This sentence also expresses a complete thought, so its meaning is clear. he=subject (S) writes=verb (V) music=direct object (DO) 1. Fused Sentence Definition: A fused sentence consists of two independent clauses, but both the comma and coordinating conjunction are missing. Example of a Fused Sentence: She writes the music he plays the guitar. ‘She writes the music’ and ‘he plays the guitar’ are each independent clauses, containing a subject and a verb and expressing complete thoughts. ‘He plays the guitar’ is an independent clause that can stand alone because it expresses a complete thought and is grammatically correct. he=subject (S)plays=verb (V)guitar=direct object (DO) However, in the above example, the independent clause, ‘She writes the music,’ incorrectly runs into a second independent clause, ‘he plays the guitar. ’ 2. Comma Splice Definition: A comma splice consists of two or more independent clauses that follow one another and are incorrectly linked together only with a comma (or commas). The coordinating conjunction is missing. Example of a Comma Splice: She writes the music, he plays the guitar. In the above sentence, a comma separates the two independent clauses, but a coordinating conjunction is also necessary. 1. Subordinating Conjunction and Relative Pronoun Fragments Example: While I was waiting for my car to be repaired. How to find this type of fragment: When proofreading a paper, pay attention to subordinating conjunctions and relative pronouns. These words (see box below) turn subjects and verbs into dependent clauses. Identifying proper usage of dependent clauses can help in recognizing fragments. 2. â€Å"-ing† Fragments Example: Her expertise being in chemistry and biology. How to find an â€Å"-ing† fragment: If the only verb in the sentence ends in ‘–ing’ and does not have a helping verb, you have a fragment. While the word ‘being’ is a verb, in the above sentence, it is not properly formed. In the below sentence, notice that the ‘-ing’ verb has a helping verb: I was walking down the street when it started raining. (This sentence is correct. ‘Was’ functions as the helping verb. ) When added to a verb, ‘-ing’ sometimes makes a verb do the job of a noun: Walking outdoors is my favorite form of exercise. (In this sentence, ‘walking’ is a noun that functions as the subject. ‘Is’ functions as the main verb. ) 3. Missing Subject Fragments Example: Security set off the alarm and evacuated the building. Next, closed all the entrances. How to find this type of fragment: The second phrase above (noted in bold) is a fragment because there is no subject. ‘Entrances’ is a noun, but it is the object of the verb ‘closed. ’ Who or what is closing the entrances is unknown. That is, the subject of the sentence is missing. 4. â€Å"Extra Information† Fragments Example: For instance, clean water and electricity. How to find and fix this type of fragment: How to cite Ways to Fix Run Ons Fragments, Essay examples