Friday, March 20, 2020

Computers vs typewriters essays

Computers vs typewriters essays Technology has made a great change with the developing of computers. Computers are the most used media in almost every business throughout the world, however, many business still use typewriters. Computers and typewriters have many differences and many similarities in technology; however, computers are more efficient than typewriters. First of all, I will write the similarities and difference of the appearance. The computer has a screen and the typewriter doesn't. The screen makes it easier to read what you are writing this is a benefit the computers have. The typewriter is smaller than the computer, this makes it convenient to store and the find room to use it. The computer takes more room and it is harder to store whenever you don't have enough room. The computer has to have a printer plugged in to be able to print. The typewriter doesn't need a printer you just need to put a paper and it is easier to print than waiting for it to come out. The computer's type board is attached be a cable and you can move it around to your conveniences, and the typewriter's keyboard is attached to it. They both have a keyboard with the same characteristics. The computer has speakers that make it an entertainment when you are working however; the typewriter in this point is more convenient because the music or noise doesn 't distract you. Both are use to type information. Next I will write about the different devices each one has, for instance both computer and typewriter need ink in order to be able to print. The typewriter needs a correction tape in order to be able to erase and the computer doesn't it is easier to go back and make any corrections. Computers have many formats and sizes and typewriters don't the just have the standard format and size. In a computer you can go to different files and programs and the typewriters don't. Both are very useful in many businesses for example, when it comes to fill out any paper work the typ...

Tuesday, March 3, 2020

The Anatomy of a Delphi Unit (for Beginners)

The Anatomy of a Delphi Unit (for Beginners) If you plan on being a good Delphi programmer than words like interface, implementation, and uses need to have special place in your programming knowledge. Delphi Projects When we create a Delphi application, we can start with a blank project, an existing project, or one of Delphis application or form templates. A project consists of all the files needed to create our target application.   The dialog box that pops up when we choose View-Project Manager lets us get access to the form and units in our project.   A project is made up of a single project file (.dpr) that lists all the forms and units in the project. We can look at and even edit the Project file (lets call it a  Project Unit) by choosing View - Project Source. Because Delphi maintains the project file, we should not normally need to modify it manually, and in general it is not recommended for inexperienced programmers to do so. Delphi Units As we know by now, forms are a visible part of most Delphi projects. Each form in a Delphi project also has an associated unit. The unit contains the source code for any event handlers attached to the events of the form or the components it contains. Since units store the code for your project, units are the basic of Delphi programming. Generally speaking, unit is a collection of constants, variables, data types, and procedures and functions that can be shared by several applications. Every time we create a new form (.dfm file), Delphi automatically creates its associated unit (.pas file) lets call it a  Form Unit. However, units dont have to be associated with forms. A  Code Unit contains code that is called from other units in the project. When you start building libraries of useful routines, you will probably store them in a code unit. To add a new code unit to Delphi application choose File-New ... Unit. Anatomy Whenever we create a unit (form or code unit) Delphi adds the following code sections automatically: unit header,  interface  section,  implementation  section. There are also two optional sections:  initialization  and  finalization. As you will see, units have to be in a  predefined  format so that the compiler can read them and compile the units code. The  unit header  starts with the reserved word  unit, followed by the units name. We need to use the units name when we refer to the unit in the uses clause of another unit. Interface Section This section contains the  uses  clause that lists the other units (code or form units) that will be used by the unit. In case of form units Delphi automatically adds the standard units such as Windows, Messages, etc. As you add new components to a form, Delphi adds the appropriate names to the uses list. However, Delphi does not add a uses clause to the interface section of code units- we have to do that manually. In the unit interface section, we can declare  global  constants, data types, variables, procedures and functions. Be aware that Delphi builds a form unit for you as you design a form. The form data type, the form variable that creates an instance of the form, and the event handlers are declared in the interface part.   Because there is no need to synchronize the code in code units with an associated form, Delphi does not maintain the code unit for you. Interface section  ends at the reserved word  implementation. Implementation Section The  implementation  section of a unit is the section that contains the actual code for the unit. The implementation can have additional declarations of its own, although these declarations arent accessible to any other application or unit. Any Delphi objects declared here would be available only to code within the unit (global to unit). An optional uses clause can appear in the implementation part and must immediately follow the implementation keyword. Initialization and Finalization Sections These two sections are optional; they are not automatically generated when you create a unit. If you want to  initialize  any data the unit uses, you can add an initialization code to the initialization section of the unit. When an application uses a unit, the code within the units initialization part is called before the any other application code runs.   If your unit needs to perform any cleanup when the application terminates, such as freeing any resources allocated in the initialization part; you can add a  finalization  section to your unit. The finalization section comes after the initialization section, but before the final end.