Sideway
output.to from Sideway
Draft for Information Only

Content

VBScript Features
  Character
  Character Code
  Data Form
   Byte
   String
  Numeric
  Array
  Object
   Examples
  Data Type
  Variant
  Variant Subtypes

VBScript Features

The sevrer side VBScripte is charactered by some typical features.

Character

The characters of VBScript keywords are restricted to the standard ASCII character set including English alphabet capital letters, English alphabet small letters, Arabic numerals, special symbols ASCII, and some ASCII control characters. While ASCII codes 01-07, 14-1F,  and 7F are not supported.

Character Code

The character code used by VBScript is Unicode. In other words, both VBScript code and data are saved in Unicode character code.

Data Form

In general, the data form used in VBScript can be divided into five catalogues, namely byte, string, numeric, array, and object.

Byte

Byte is the basic data storage unit of VBScript. A Byte is composed of 8 bits. A Boolean value is stored in form of string in VBScript, but a Boolean value can also be converted to a Byte using CByte function. Since the character code used by VBScript is Unicode, the basic character code unit is in form of a Char of 2 bytes. However, a character may be composed of 2 or 4 bytes. For all Unicode characters in the Basic plane, the character code unit is composed of 2 bytes. But for Unicode character outside the Basic plane, the character code unit is composed of 4 bytes.

String

String is the fundamental information unit of VBScript. A String is a character string that is composed of characters in form of a string of characters in which a character may be a 2 or 4 bytes Unicode character. But a character String that contains no character is a zero-length string, "", with 0 bytes in terms of length of byte. A string of characters is enclosed by double quotes to indicated that the specified is a character String not variable.

Numeric

Numeric is a special form of String in VBScript. The numeric information of form String is converted into numeric value. Sometime a string expression refers to a character string, while a numeric expression refers to a numeric value.

Array

An array is a container that is used to hold a number of values in form of indexed items. The first index number of an Array is zero for VBScript, that is so called a zero-based array. An Array with one index is called one or single dimension Array. An Array can be in multiidimensional. The dimension of an array indicates the number of indices that is needed when selecting an element. An Array can also be in compound form by embedding an Array to the element of an Array.

Object

An Object is a complex container that is used to hold anumber of things in form of a collection of items. Things insides an Object may be anything, a collection, a property, a method, or an event. In other words, an Object can be considered as a complex procedure which is driven by relation instead of a compound function driven by parameter.

Examples

Examples of VarType and TypeName functions
ASP VbScript Command:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
<script runat="server" language="VBScript">
Function printdata
cmda=array("a","LenB(a)","b","LenB(b)"):ucnt=UBound(cmda):call heading
vars="a=True:b=CByte(a)":dsp_x
vars="a=False:b=CByte(a)":dsp_x
vars="a=""True"":b=CByte(CBool(a))":dsp_x
vars="a=""False"":b=CByte(CBool(a))":dsp_x
vars="a=""a"":b=""1""":dsp_x
vars="a="" "":b=""""":dsp_x
vars="a=""%EF%A4%86"":b=""%F0%AF%A0%84""":dsp_x
vars="a=""ABCDEFG"":b=""abcdefg""":dsp_x
vars="a=123467:b=""1234567""":dsp_x
vars="a=1.23467:b=""1E+1""":dsp_x
vars="a=Array(1,2):b=Split(""1 2"")":dsp_x
vars="Set a=GetObject("""",""htmlfile""):Set b=CreateObject(""Scripting.Dictionary"")":dsp_x
End Function
Dim abb,cnt,cmda,cmp,dai,dlt,dte,dad,e,fnd,flg,fir,f_dw,gbd,hor,i,ild,k,mth,min,num,pnn,pi,sec,str1,str2,str,strs,tme,tmp,ucnt,var,vars,varx,wkd,x,z:varx=0
Function heading:If var=1 Then:tmp="":Else:tmp="<b>vars</b>":End If:For i=0 to ucnt:tmp=tmp&"<b>"&rmv_ctrl(cmda(i))&", TypeName</b>":Next:Response.Write "Results on Microsoft Windows Server 2008 R2 Standard  x64, Microsoft-IIS/7.5, VB Version 14.0<br />"&"<i>"&tmp&"</i>":End Function
Function dsp_x:Dim tmp_a,tmp_b,i:If varx=0  Then:Execute vars:End If:If var=1 Then:tmp_a="":Else:tmp_a=rmv_ctrl(vars):End If:For i=0 to ucnt:tmp_b=cmd_b(cmda(i)):if i/2=fix(i/2) Then:tmp_b="<b>"&tmp_b&"</b>":End If:tmp_a=tmp_a&tmp_b:Next:Response.Write "<i>"&tmp_a&"</i>":End Function
Function rmv_ctrl(blk_str):Select Case blk_str:Case chr(0):blk_str="NUL":Case chr(1):blk_str="SOH":Case chr(2):blk_str="STX":Case chr(3):blk_str="ETX":Case chr(4):blk_str="EOT":Case chr(5):blk_str="ENQ":Case chr(6):blk_str="ACK":Case chr(7):blk_str="BEL":Case chr(8):blk_str="BS":Case chr(9):blk_str="HT":Case chr(10):blk_str="LF":Case chr(11):blk_str="VT":Case chr(12):blk_str="FF":Case chr(13):blk_str="CR":Case chr(14):blk_str="SO":Case chr(15):blk_str="SI":Case chr(16):blk_str="DLE":Case chr(17):blk_str="DC1":Case chr(18):blk_str="DC2":Case chr(19):blk_str="DC3":Case chr(20):blk_str="DC4":Case chr(21):blk_str="NAK":Case chr(22):blk_str="SYN":Case chr(23):blk_str="ETB":Case chr(24):blk_str="CAN":Case chr(25):blk_str="EM":Case chr(26):blk_str="SUB":Case chr(27):blk_str="ESC":Case chr(28):blk_str="FS":Case chr(29):blk_str="GS":Case chr(30):blk_str="RS":Case chr(31):blk_str="US":Case chr(127):blk_str="DEL":End Select:rmv_ctrl=blk_str:If IsNull(blk_str) OR IsEmpty(Blk_str) OR blk_str="" OR IsNumeric(Blk_str) Then:Else:rmv_ctrl=Replace(Replace(Replace(Replace(Replace(blk_str,"&","&amp;"),"  "," &nbsp;"),"""","&quot;"),"<","&lt;"),">","&gt;"): End If :End Function
Function cmd_b(blk_str):cmd_b="["&cmd_x(blk_str)&"], "&cmd_x("TypeName("&blk_str&")"):End Function
Function cmd_x(blk_str):On Error Resume Next:Dim xans, tmp:xans="":tmp="":execute "xans="&blk_str:If Err.Number <> 0  Then:xans=cmd_x("TypeName("&blk_str&")"):Select Case xans:Case 9::Case Else:xans="error":End Select:End If:If IsArray(xans)=False Then:cmd_x=rmv_ctrl(xans): Else:tmp=lst_arry(xans):cmd_x=trim(tmp):End If:End Function
Function lst_arry(blk_str):Dim tmp,i,q:q="""":tmp="":For i=0 to UBound(blk_str):if VarType(blk_str(i))>1 And VarType(blk_str(i))<6 Then:q="'":End If:tmp=tmp&" "&q&rmv_ctrl(blk_str(i))&q:Next:lst_arry=trim(tmp):End Function
</script>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 
        <style type="text/css">
           i {display:table-row}
           u,b {display:table-cell}
        </style>
    </head>
    <body>
<%call printdata %>
    </body>
</html>
HTML Web Page Embedded Output:

Data Type

VBScript has only one data type called a Variant.

Variant

A Variant is a special kind of data type that can contain different kinds of information, depending on how it's used. VBScript always assumes the most appropriate data type for those Variants with no specified Data Subtype.

Variant Subtypes

The subtypes of a Variant is used to distinct the specific nature of information by catalogue. The supported subtypes of VBScript are Empty, Null, Boolean, Byte, Integer, Currency, Long, Single, Double, Date, String , Object, and Error. The descriptions of data subtypes are

SubtypeDescriptionEmptyNo data is assigned. Variant is uninitialized. Evaluted value is 0 for numeric variables or a zero-length string ("") for string variables.NullNo valid data is contained. Variant intentionally contains no valid data.BooleanData contained is either True or False.ByteData contained is an integer in the range 0 to 255.IntegerData contained is an integer in the range -32,768 to 32,767.Currency-922,337,203,685,477.5808 to 922,337,203,685,477.5807.LongData contained is an integer in the range -2,147,483,648 to 2,147,483,647.SingleData contained is a single-precision, floating-point number in the range -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.DoubleData contained is a double-precision, floating-point number in the range -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.DateData contained is a number that represents a date between January 1, 100 00:00:00 to December 31, 9999 23:59:59.StringData contained is a variable-length string that can be up to approximately 2 billion characters in length.ObjectData contained is an object reference.ErrorData contained is an error number.

©sideway

ID: 171100031 Last Updated: 11/30/2017 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019