66 views

Uploaded by nazeer.pasha

- Reviewer Comp-OODBMS
- B VBScript07
- B VBScript02
- B VBScript05
- The Ring programming language version 1.5.1 book - Part 172 of 180
- Coding
- B VBScript11
- B VBScript04
- Onhand Quantity Conversion
- B VBScript06
- B VBScript08
- B VBScript09
- B VBScript10
- B VBScript01
- Math Handout 03
- Code
- A lógica Paraconsistente Z
- Dialogical Logic
- 20761B_07
- bolean algebra

You are on page 1of 18

Session 3

Dani Vainstein 1

What We learn Last seasson?

Working with one dimensional a multi-

dimensional arrays.

Working with Dynamic arrays.

Arrays utilities (Array,UBound, LBound)

Dani Vainstein 2

Subjets for Session 3

Const Statement.

Operators.

Arithmetic.

Comparision.

Logical.

Dani Vainstein 3

Constants

Const Statement

number or string and never changes.

VBScript defines a number of intrinsic constants.

You create user-defined constants in VBScript using the

Const statement.

Dani Vainstein 4

Constants

Const Statement

from variables.

This will prevent you from trying to reassign constant values while

your script is running.

For example, you might want to use a "vb" or "con" prefix on your

constant names, or you might name your constants in all capital

letters:

conMaxValue, vbMyValue, MY_VALUE

Differentiating constants from variables eliminates confusion as

you develop more complex scripts.

Const MyAge = 19

Const CutoffDate = #6-1-97#

Dani Vainstein 5

VBScript Operators

VBScript has a full range of operators, including

arithmetic operators, comparison operators,

concatenation operators, and logical operators.

When several operations occur in an expression, each

part is evaluated and resolved in a predetermined order

called operator precedence.

You can use parentheses to override the order of

precedence and force some parts of an expression to be

evaluated before others.

Operations within parentheses are always

performed before those outside.

Dani Vainstein 6

VBScript Operators

one category, arithmetic operators are evaluated first,

comparison operators are evaluated next, and logical

operators are evaluated last.

Comparison operators all have equal precedence; that

is, they are evaluated in the left-to-right order in

which they appear.

Arithmetic and logical operators are evaluated in the

following order of precedence.

Dani Vainstein 7

VBScript Operators

Arithmetic Operators

Exponentation operator

Symbol : ^

Description: Raises a number to the power of an exponent.

Syntax: result = number^exponent

Note: If either number or exponent is a Null expression, result is also Null.

Substraction operator

Symbol : -

Description: Finds the difference between two numbers or indicates the

negative value of a numeric expression.

Syntax: result = number1-number2 : -number

Note: If one or both expressions are Null expressions, result is Null. If an

expression is Empty, it is treated as if it were 0.

Dani Vainstein 8

VBScript Operators

Arithmetic Operators

Multiplication operator

Symbol : *

Description: Multiplies two numbers.

Syntax: result = number1*number2

If one or both expressions are Null expressions, result is Null. If an

expression is Empty, it is treated as if it were 0.

Division operator

Symbol : /

Description: Divides two numbers and returns a floating-point result.

Syntax: result = number1/number2

Note: If one or both expressions are Null expressions, result is Null. If an

expression is Empty, it is treated as if it were 0.

Dani Vainstein 9

VBScript Operators

Arithmetic Operators

Symbol : \

Description: Divides two numbers and returns an integer result.

Syntax: result = number1\number2

Note: Before division is performed, numeric expressions are

rounded to Byte, Integer, or Long subtype expressions.

If any expression is Null, result is also Null. Any expression that is

Empty is treated as 0.

Dani Vainstein 10

VBScript Operators

Arithmetic Operators

Symbol : Mod

Description: Divides two numbers and returns only the

remainder.

Syntax: result = number1 Mod number2

Notes: The modulus, or remainder, operator divides number1 by

number2 (rounding floating-point numbers to integers) and returns

only the remainder as result.

If any expression is Null, result is also Null. Any expression that is

Empty is treated as 0.

Dani Vainstein 11

VBScript Operators

Arithmetic Operators

Addition operator

Symbol : +

Description: Sums two numbers.

Syntax: result = number1+number2

Note: Although you can also use the + operator to concatenate

two character strings, you should use the & operator for

concatenation to eliminate ambiguity and provide self-documenting

code.

Dani Vainstein 12

VBScript Operators

Arithmetic Operators

Concatenation operator

Symbol : &

Description: Forces string concatenation of two expressions.

Syntax: result = expression1 & expression2

Notes: Whenever an expression is not a string, it is converted to a String

subtype.

If both expressions are Null, result is also Null.

However, if only one expression is Null, that expression is treated as a zero-

length string ("") when concatenated with the other expression.

Any expression that is Empty is also treated as a zero-length string.

Dani Vainstein 13

VBScript Operators

Comparision Operators

Symbol : =, <, <=, >, >=, <>

Description: Used to compare expressions.

Syntax: result = expression1 comparisonoperator expression2

Note: When comparing two expressions, you may not be able to easily

determine whether the expressions are being compared as numbers or as

strings.

In operator

Symbol : In

Description: Compares two object reference variables.

Syntax: result = object1 Is object2

Note: If object1 and object2 both refer to the same object, result is True;

if they do not, result is False.

Dani Vainstein 14

VBScript Operators

Logical Operators

Symbol : Not

Description: Performs logical negation on an expression.

Syntax: result = Not expression

True False

False True

Null Null

Dani Vainstein 15

VBScript Operators

Logical Operators

Symbol : And

Description: Performs a logical conjunction on two expressions.

Syntax: result = expression1 And expression2

True False False

True Null Null

False True False

False False False

False Null False

Null True Null

Null False False

Null Null Null

Dani Vainstein 16

VBScript Operators

Logical Operators

Symbol : Or

Description: Performs a logical disjunction on two expressions.

Syntax: result = expression1 Or expression2

True False True

True Null True

False True True

False False False

False Null Null

Null True True

Null False Null

Null Null Null

Dani Vainstein 17

VBScript Operators

Logical Operators

Symbol : Xor

Description: Performs a logical exclusion on two expressions.

Syntax: result = expression1 Xor expression2

is

True True False

True False True

False False False

Dani Vainstein 18

- Reviewer Comp-OODBMSUploaded byMC Aberca
- B VBScript07Uploaded bynazeer.pasha
- B VBScript02Uploaded byjohnson manesh
- B VBScript05Uploaded byjohnson manesh
- The Ring programming language version 1.5.1 book - Part 172 of 180Uploaded byMahmoud Samir Fayed
- CodingUploaded byArpit
- B VBScript11Uploaded bynazeer.pasha
- B VBScript04Uploaded bynazeer.pasha
- Onhand Quantity ConversionUploaded byBalaji Shinde
- B VBScript06Uploaded bynazeer.pasha
- B VBScript08Uploaded bynazeer.pasha
- B VBScript09Uploaded bynazeer.pasha
- B VBScript10Uploaded bynazeer.pasha
- B VBScript01Uploaded bynazeer.pasha
- Math Handout 03Uploaded bygcuusman
- CodeUploaded byKevin
- A lógica Paraconsistente ZUploaded byAllan Dennis Araújo Melo
- Dialogical LogicUploaded byEricPezoa
- 20761B_07Uploaded byAbdul-alim Bhnsawy
- bolean algebraUploaded byJecil Mirafuentes Tabotabo
- Introduction to Pro_CUploaded byHenriqueDaGamaFernandes
- Data CubeUploaded byKamlesh Chauhan
- J-87-13-II (Computer Science & Applications)Uploaded byr_k_s
- gfdgdgTextUploaded bytest
- chapter 2, 3Uploaded bytbijle
- 1-15Uploaded byRohit Jain
- 15 Temporal ValidityUploaded bygmasay
- lec2Uploaded byZhichaoWang
- AssessmentUploaded byconcrete_donkey
- SQL Lab 3 RequestsUploaded bydadada121

- JobEditor Manual en 01Uploaded bymartinimartiini
- Homework SolutionUploaded byyashar2500
- PPE Unit 3 Network TechniquesUploaded byHemant Dwivedi
- chapter 5Uploaded byerma
- Bayesian Networks With RUploaded byMubanga
- Data Warehouse and ETL Verification Services Process MethodsUploaded byWayne Yaddow
- eea051-05 state diagram.pdfUploaded byCLARITY UDT
- Software Requirement Specification - Tariq KhanUploaded bysun.developer7227
- Device Configuration OverlayUploaded byGabb007
- Rics 2011 BIM Survey ReportUploaded bypresario60
- Avery Dennison ALX924 Labelprinter parametersUploaded byKenneth Thoft Andersen
- Ui5_example1Uploaded byAbhishek Gupta
- Agile Notetaker eCommerce BookUploaded byrforteza
- PBN FootprintsUploaded bykontactg
- Requirement SpecificationUploaded bypromitbhagat
- CS102-08 Multikey File OrgUploaded byJoanne Tan
- Telnet CommandsUploaded byNithindev Guttikonda
- Case Study Test&ControlUploaded byAnkit
- BRIDGE CRM ECC V2 Consistent System RefreshUploaded byPhanikumar Thammisetti
- 2-Word.pdfUploaded byPravina Panchal
- XML Part of Container English SaxUploaded bypuneetharman144
- Salesforce Relationship TypesUploaded byGayatri Sharma
- BI CapacityPlanningUploaded byDeportivo_Quito
- Hindi/Urdu GrammarUploaded byArianna Mohiuddin
- Dorado's GroupUploaded byJay Ar Dorado ⎝⏠⏝⏠⎠
- Chapter 3 SIC: PPP, Routing, and Remote Access VPN AnswersUploaded byCCNA V6
- Principles of Data CommunicationUploaded byMisha Echipare Antonio
- paper_1.pdfUploaded byFelipe Canever Fernandes
- Project Scheduling and Crashing.pptUploaded byJagdishSingh
- How to Create a PAS Model With Cube Builder for Strategy Management SM7.0Uploaded byAdnan_HR