Dani Vainstein1 VBScript Session 8. Dani Vainstein2 What we learn last session? VBScript procedures. Sub procedures. Function Procedures. Getting data.

Slides:



Advertisements
Similar presentations
1 VBScript Session What we learn last session?
Advertisements

P5, M1, D1.
Chapter 1: Computer Systems
Tutorial 12: Enhancing Excel with Visual Basic for Applications
The Web Warrior Guide to Web Design Technologies
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Introduction to C Programming
Documentation 1 Comprehending the present – Investing in the future.
Example 2.
Chapter 5 - Menus, Sub Procedures, and Sub Functions  Menus - controls - properties and events –menu editor - create and change –defining menus - menu.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
CSE1301 Computer Programming: Lecture 13 Documentation.
Introduction to C Programming
Features of technical writing Personal( I, we) vs impersonal (writer, author), one - ambiguity Passive vs active Clarity- redundant words Nominalization.
Fundamentals of Python: From First Programs Through Data Structures
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Apply Sub Procedures/Methods and User Defined Functions
Bret Juliano. Introduction What Documentation is Required? – To use a program – To believe a program – To modify a program The Flow-Chart Curse Self-Documenting.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Dani Vainstein & Monika Arora Gautam 1 Utils Layer Building Library Functions.
Dani Vainstein1 VBScript Session 9. Dani Vainstein2 What we learn last session? VBScript coding conventions. Code convention usage for constants, variables,
Fundamentals of Python: First Programs
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Good Programming Practices. 2 home back first prev next last What Will I Learn? List examples of good programming practices Accurately insert comments.
The Java Programming Language
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 7 Sub and Function Procedures.
Chapter 6 Sub Procedures
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Advanced Computer Science Lab Coding Style & Documentation.
Dani Vainstein1 VBScript Session 1. Dani Vainstein2 Subjets for Session 1 Vbscript fundamentals. Variant subtypes. Variables. Option Explicit statement.
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Coding Conventions  Coding conventions are a set of guidelines for a specific software project that recommend programming style, practices and methods.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Review of HTML and CSS A (very) brief review of some key fundamentals to be aware of in IT-238.
Controlling Program Flow with Decision Structures.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Dani Vainstein1 VBScript Session 5. Dani Vainstein2 What we learn last session? Branching Branching using If … Then … Else statement. Branching using.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Abstract  An abstract is a concise summary of a larger project (a thesis, research report, performance, service project, etc.) that concisely describes.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Chapter 15 - C++ As A "Better C"
VBScript Session 1 Dani Vainstein.
Working with Java.
Chapter 2 - Introduction to C Programming
Visual Basic I Programming
Chapter 2 - Introduction to C Programming
Microsoft Access Illustrated
Microsoft Office Illustrated
Chapter 6 Variables What is VBScript?
VBScript Session 4 Dani Vainstein.
Chapter 2 - Introduction to C Programming
Hands-on Introduction to Visual Basic .NET
VBScript Session 6 Dani Vainstein.
Chapter 1: Computer Systems
VBScript Session 7 Dani Vainstein.
Coding practices For IT and Computing students 2014.
VBScript Session 1.
Tonga Institute of Higher Education
Variables in C Topics Naming Variables Declaring Variables
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

Dani Vainstein1 VBScript Session 8

Dani Vainstein2 What we learn last session? VBScript procedures. Sub procedures. Function Procedures. Getting data into and out of procedures Call statement. Using arguments ByVal and ByRef.

Dani Vainstein3 Subjects for session 8 VBScript coding conventions Constant naming conventions. Variable naming conventions. Descriptive variable and procedure names. Object naming conventions. Code commenting conventions. Functions header conventions.

Dani Vainstein4 VBScript Coding Conventions Coding conventions are suggestions are designed to help you write code using Microsoft Visual Basic Scripting Edition. Coding conventions can include the following: Naming conventions for objects, variables, and procedures. Commenting conventions. Text formatting and indenting guidelines. The main reason for using a consistent set of coding conventions is to standardize the structure and coding style of a script or set of scripts so that you and others can easily read and understand the code. Using good coding conventions results in clear, precise, and readable source code that is consistent with other language conventions and is intuitive.

Dani Vainstein5 VBScript Coding Conventions Constant Naming Conventions Earlier versions of VBScript had no mechanism for creating user- defined constants. Constants, if used, were implemented as variables and distinguished from other variables using all uppercase characters. Multiple words were separated using the underscore (_) character. For example: USER_LIST_MAX NEW_LINE you can create true constants using the Const statement. This convention uses a mixed-case format in which constant names have a "con" prefix. For example: conYourOwnConstant

Dani Vainstein6 VBScript Coding Conventions Variable Naming Conventions To enhance readability and consistency, use the following prefixes with descriptive names for variables in your VBScript code. ExamplePrefixSubtype blnFound, bFoundbln, bBoolean bytRasterDatabytByte dtmStartdtmDate (Time) dblTolerancedblDouble strFirstNamestrString iQuantity, intQuantityi, intInteger lngDistancelngLong objCurrentobjObject sngAveragesngSingle

Dani Vainstein7 Descriptive Variable and Procedure Names The body of a variable or procedure name should use mixed case and should be as descriptive as necessary. In addition, procedure names should begin with a verb, such as InitNameArray or CloseDialog. For frequently used or long terms, standard abbreviations are recommended to help keep name length reasonable. In general, variable names greater than 32 characters can be difficult to read. When using abbreviations, make sure they are consistent throughout the entire script. For example, randomly switching between Cnt and Count within a script or set of scripts may lead to confusion.

Dani Vainstein8 VBScript Coding Conventions Object Naming Conventions PrefixSubtypePrefixSubtype linLinepnl3D Panel fraFramechkCheck box hsbHorizontal scroll barcboCombo box vsbVertical scroll barcmdCommand button winWindowbtnRadio button shtSheet Object (Excel)dlgCommon dialog jJava ObjectsimgImage tbrTool BarlblLabel arrArrayslstList box fldFolderspnSpin fleFiletxtText box drvDrivesldSlider txsTextStream (FSO)rstRecordset object dicDictionary xlsExcel application object cnxConnetion object

Dani Vainstein9 VBScript Coding Conventions Code Commenting Conventions All procedures should begin with a brief comment describing what they do. description should not describe the implementation details (how it does it) because these often change over time, resulting in unnecessary comment maintenance work, or worse, erroneous comments. The code itself and any necessary inline comments describe the implementation. Arguments passed to a procedure should be described when their purpose is not obvious and when the procedure expects the arguments to be in a specific range. Return values for functions and variables that are changed by a procedure, especially through reference arguments, should also be described at the beginning of each procedure.

Dani Vainstein10 VBScript Coding Conventions Function Header Module Name: Propose : Author: Date: 23-Mar-2004 Modifications: # By, Date: Description: Input Params: [ ] - [ ] - Return Values: If the function success it returns… If the function fails it returns… Remarks: Syntax:

Make sure to visit us Tutorials Articles Projects And much more 11