A Brief Introduction to VBScript

Share Embed Donate


Short Description

VB Script is very light weight easy scripting language. It is not case-sensitive, provides arithmetic operators, logical...

Description

Introduction to Visual Basic Script (VBScript)

 Apex T. T. G. India Pvt. Ltd Ltd

Content 

Visual Basic Script (VBScript) ◦

Subset of icrosoft Visual Basic



I! contains VBScript scriptin" en"ine (interpreter)



Si#ilar to $avaScript



$avaScript used #ore for client%side scriptin"



VBScript de facto lan"ua"e for ASP (Active Server Pa"es)

Dynamic HTML: Client-Side Scripting with VBScript Outline Introduction Operator Data Type and Control Structure VBScript !unction VBScript "#ample $rogram %rray String Manipulation Clae and O&'ect

Operators  Operators 

VBScript ◦





 (ot cae-eniti)e $ro)ide arithmetic operator* logical operator* concatenation operator* comparion operator and relational operator %rithmetic operator 

Similar to +a)aScript arithmetic operator



Di)iion operator 





\



,eturn integer reult

"#ponentiation operator  

^



,aie a )alue to a power 

Operators    Comparion operator . Only ym&ol /or e0uality operator 1 =2 and ine0uality operator 1 2 di//er /rom +a)aScript . Can alo &e ued to compare tring    Logical operator . And 1logical %(D2 . Or 1logical O,2 . Not 1logical negation2 . Imp 1logical implication2 . Xor 1e#clui)e O,2 . Eqv 1logical e0ui)alence2 .  (ot hort-circuit3 &oth &oth condition alway e)aluated

Comparison operators Standard VBScript "#ample o/ Meaning o/ VBScript alge&raic e0uality comparion VBScript condition operator or operator condition relational operator =

=

d = g

d   is equal to g  is



 

s r

s is not equal to r

>

>

y > x

y is greater than x

<

 <

p < m



>=

c >= z



 ?8>7@5>;"-5> 5>;"-5> 1negati)e2 @?;8;= 1poiti)e2

"mpty

Aninitialied? Thi )alue i 7 /or numeric type 1e?g?* dou&le2* False /or Aninitialied?  &oolean and and the empty string  1i?e?*  1i?e?* ""2 /or tring?

Integer

-5;== to 5@>;>=;

O&'ect

%ny o&'ect type?

Single

-?>75=5"= to -@?>7@58="->6 1negati)e2 ?>75=5"= to @?>7@58="->6 1poiti)e2

String

7 to 5777777777 character?

%ata 'pes and Control (tru)tures 

VBScript control tructure ◦



")ery control tructure &egin and end with one or more 4eyword 1not curly &race a in +a)aScript2 VBScript doe not ue tatement terminator  

+a)aScript ue emicolon



$arenthee around condition optional



rue: )ariant u&type Boolean rue or conidered non-ero



.alse: )ariant u&type Boolean .alse or conidered 7

Comparin/ ,()ript )ontrol stru)ture ssttru)tures ru)turess to 0ava()ript )ontrol stru)tures stru)tures

%ata 'pes and Control (tru)tures JavaScript

VBScript

1 2 3  ! 

1 2 3  !  '

if ( u else u else u

s == t ) = s + t; if ( s > t ) = r; = #;

$f s = u = &lse$f u = &lse u = &#d $f

t T%e# s + t s > t T%e# r #

Comparing +a)aScript if tructure if tructure to VBScript $f tructure $f tructure JavaScript

VBScript

1 sitc% ( x )  2 case 1* 3 alert("1");   rea,; ! case 2*  alert("2"); '  rea,; default* . alert("/"); 10 

1 2 3  !  ' -

elect ase x ase 1 all 4sg56x("1") ase 2 all 4sg56x("2") ase &lse all 4sg56x("/") &#d elect

Comparin/ 0ava()ript1s s(itc% to ,()ript1s 2elect 3ase

%ata 'pes and Control (tru)tures

Comparing +a)aScript (%ile to  (%ile to VBScript 76 8#til

d69(%ile to VBScript 76 :66p98#til Comparing +a)aScript d69(%ile to

Comparing +a)aScript f6r to f6r to VBScript F6r

Thanks (ta' Conne)ted 2it# us or more )#apters on ,(s)ript

/ace&oo4?com9ape#?tgi

twitter?com9%pe#tgi(oida

 pinteret?com9ape#tgi  pinteret?com9a pe#tgi

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF