Sie sind auf Seite 1von 4

SOALAN 1 What are objects and properties? How are they related to each other?

Objects Think of an object as a thing, or a noun. Examples of objects are forms and con-trols. Forms are the windows and dialog boxes you place on the screen; controls are the components you place inside a form, such as text boxes, buttons, and list boxes. Properties Properties tell something about or control the behavior of an object, such as its name, color, size, or location. You can think of properties as adjectives that de-scribe objects. When you refer to a property, you first name the object, add a period, and then name the property. For example, refer to the Text property of a form called SalesForm as SalesForm.Text (pronounced sales form dot text) Objects related to properties for editing the objects option SOALAN 2 What are the 3 steps for planning and creating Visual Basic Projects? 1. Design the user interface. 2. Plan the properties. 3. Plan the Basic code SOALAN 3 Describe what happen in each step? 1. Design the user interface. When you plan the user interface, you draw a sketch of the screens the user will see when running your project. On your sketch, show the forms and all the controls that you plan to use. Indicate the names that you plan to give the form and each of the objects on the form. Refer to Figure 1.1 for examples of user interfaces. Before you proceed with any more steps, consult with your user and make sure that you both agree on the look and feel of the project. 2. Plan the properties. For each object, write down the properties that you plan to set or change during the design of the form. 3. Plan the Basic code . In this step, you plan the classes and procedures that will execute when your project runs. You will determine which events require action to be taken and then make a step-by-step plan for those actions. Later, when you actually write the Visual Basic code, you must follow the language syntax rules. But during the planning stage, you will write out the actions using pseudocode, which is an English expression or comment that describes the action. For example, you must plan for the event that occurs when the user clicks on the Exit button. The pseudocode for the event could be Terminate the project or Quit .

SOALAN 4 What is the purpose of these Visual Basic file types: .sln, .suo and .vb? File Name HelloWorld.sln File Icon Description The solution file. A text file that holds information about the solution and the projects it contains. This is the primary file for the solutionthe one that you open to work on or run your project. Note the 10 on the icon, which refers to VB version 10 Solution user options file. Stores information about the state of the integrated development Environment(IDE) so that all customizations can be restored each time you open the solution. A .vb file that holds the code procedures that you write. This is a text file that you can open in any editor. Warning: You should not modify this file unless you are using the editor in the Visual Studio environment.

HelloWorld.suo

HelloForm.vb

SOALAN 5 What is Visual Basic in Design Time? Run Time? Debug Time? Visual Basic has three distinct modes. While you are designing the user interface and writing code, you are in design time. When you are testing and running your project, you are in run time. If you get a runtime error or pause program execution, you are in debug time. The IDE window title bar indicates (Running) or (Debugging) to indicate that a project is no longer in design time. SOALAN6 What is the purpose of the Name property of a control?

SOALAN 10 What property must be set to center text in a label? What should be the value of the property? The TextAlign property under the label properties(Appearance).

The Value must set to MiddleCenter

SOALAN 13 What is syntax error, when does it occur and what might cause it? Syntax errors are those that appear while you write code. Visual Basic checks your code as you type it in the Code Editor window and alerts you if you make a mistake, such as misspelling a word or using a language element improperly. Syntax errors are the most common type of errors. You can fix them easily in the coding environment as soon as they occur. The Option Explicit statement is one means of avoiding syntax errors. It forces you to declare, in advance, all the variables to be used in the application. Therefore, when those variables are used in the code, any typographic errors are caught immediately and can be fixed

SOALAN 14 What is run-time error, when does it occur and what might cause it?

Run-time errors are those that appear only after you compile and run your code. These involve code that may appear to be correct in that it has no syntax errors, but that will not execute. For example, you might correctly write a line of code to open a file. But if the file is corrupted, the application cannot carry out the Open function, and it stops running. You can fix most run-time errors by rewriting the faulty code, and then recompiling and rerunning it. SOALAN 15 What is logic error, when does it occur and what might cause it? Logic errors are those that appear once the application is in use. They are most often unwanted or unexpected results in response to user actions. For example, a mistyped key or other outside influence might cause your application to stop working within expected parameters, or altogether. Logic errors are generally the hardest type to fix, since it is not always clear where they originate.

SOALAN 12

Das könnte Ihnen auch gefallen