Sideway
output.to from Sideway





VBScript Data


Draft for Information Only

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:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("a","LenB(a)","b","LenB(b)")
Dim ucnt,tmp,i:ucnt=UBound(cmda):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 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /sideway/default.asp<br />"&"<i>"&tmp&"</i>"
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

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=""句"":b=""你""":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
</script>
HTML Web Page In-line Output:
Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /sideway/default.asp
varsa, TypeNameLenB(a), TypeNameb, TypeNameLenB(b), TypeNamea=True:b=CByte(a)[True], Boolean[8], Long[255], Byte[6], Longa=False:b=CByte(a)[False], Boolean[10], Long[0], Byte[2], Longa="True":b=CByte(CBool(a))[True], String[8], Long[255], Byte[6], Longa="False":b=CByte(CBool(a))[False], String[10], Long[0], Byte[2], Longa="a":b="1"[a], String[2], Long[1], String[2], Longa=" ":b=""[ ], String[2], Long[], String[0], Longa="句":b="你"[句], String[2], Long[你], String[4], Longa="ABCDEFG":b="abcdefg"[ABCDEFG], String[14], Long[abcdefg], String[14], Longa=123467:b="1234567"[123467], Long[12], Long[1234567], String[14], Longa=1.23467:b="1E+1"[1.23467], Double[14], Long[1E+1], String[8], Longa=Array(1,2):b=Split("1 2")['1' '2'], Variant()[error], error["1" "2"], Variant()[error], errorSet a=GetObject("","htmlfile"):Set b=CreateObject("Scripting.Dictionary")[[object]], HTMLDocument[16], Long[Dictionary], Dictionary[error], error

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: 2017/11/30 Revision:

IMAGE

Home (1)

Business

Management

HBR (3)

Information

Recreation

Hobbies (7)

Culture

Chinese (1037)new

English (330)

Reference (57)

Computer

Hardware (111)

Software

Application (169)new

Digitization (20)

Numeric (19)

Programming

Web (376)

HTML

Knowledge Base

Common Color (1)

Html Entity (Unicode) (1)

Html 401 Special (1)

OS (263)

MS Windows

Windows8.1 (1)

DeskTop (5)

Knowledge

Mathematics

Formulas (6)

Number Theory (51)

Algebra (14)

Trigonometry (18)

Geometry (18)

Calculus (66)

Engineering

Tables (8)

Mechanical

Control

Process Control (1)

Mechanics (1)

Rigid Bodies

Statics & Dynamics (128)

Fluid (5)

Fluid Kinematics (5)

Acoustics (19)

FiniteElement (2)

Biology (1)

Geography (1)

Valid XHTML 1.0 Transitional Valid CSS!
Nu Html Checker Firefox53 Chromena IExplorerna


facebook
Latest Updated Links

Copyright © 2000-2017 Sideway . All rights reserved Disclaimersfacebook last modified on 19 May 2015