Sideway
output.to from Sideway





Draft for Information Only

Content

VBScript Declaration Statement
 Const Statement
  Syntax
  Argument
  Remarks
  Requirement
 Examples
 Dim Statement
  Syntax
  Argument
  Remarks
  Requirement
 ReDim Statement
  Syntax
  Argument
  Remarks
  Requirement
 Examples
 Erase Statement
  Syntax
  Argument
  Remarks
  Requirement
 Examples
 Private Statement
  Syntax
  Argument
  Remarks
  Requirement
 Public Statement
  Syntax
  Argument
  Remarks
  Requirement
 Examples

VBScript Declaration Statement

The declaration statements are Const Statement.

Const Statement

last updated 2017/11/21

to declare constants for use in place of literal values.

Syntax

[Public | Private] Const constname = expression[, constname = expression]…

Argument

PublicOptional keyword that cannot be used together with Private. Keyword used at script level to declare constants that are available to all procedures in all scripts. Not allowed in procedures.PrivateOptional keyword that cannot be used together with Public. Keyword used at script level to declare constants that are available only within the script where the declaration is made. Not allowed in procedures.ConstRequired keyword. To indicate the start of Const.constnameRequired. To specify the name of the constant following the standard variable naming conventions.expressionRequired. Literal or other constant, or any combination that includes all arithmetic or logical operators except Is.,Optional separator. to be used as delimiter when declaring multiple constants on same line.

Remarks

  • Constants are public by default. Within procedures, constants are always private; their visibility can't be changed. Within a script, the default visibility of a script-level constant can be changed using the Private keyword.
  • To combine several constant declarations on the same line, separate each constant assignment with a comma. When constant declarations are combined in this way, the Public or Private keyword, if used, applies to all of them.
  • Variables, user-defined functions, or intrinsic VBScript functions (such as Chr) cannot be used in constant declarations. By definition, they can't be constants.
  • A constant also cannot be created from any expression that involves an operator, that is, only simple constants are allowed.
  • Constants declared in a Sub or Function procedure are local to that procedure.
  • A constant declared outside a procedure is defined throughout the script in which it is declared.
  • Constants can ye used in anywhere an expression is used.
  • Constants are used to make scripts self-documenting and easy to modify. However, unlike variables, constants cannot be inadvertently changed while the script is running.

Requirement

5, 2

Examples

Examples of Const Statement

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("a","b","c")
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="Const aa=3:a=aa":dsp_x
vars="Public Const bb=4:b=bb"::dsp_x
vars="Private Const cc=5:c=cc"::dsp_x
vars="Const dd=6,ee=7:b=dd:c=ee":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, TypeNameb, TypeNamec, TypeNameConst aa=3:a=aa[3], Integer[], Empty[], EmptyPublic Const bb=4:b=bb[3], Integer[4], Integer[], EmptyPrivate Const cc=5:c=cc[3], Integer[4], Integer[5], IntegerConst dd=6,ee=7:b=dd:c=ee[3], Integer[6], Integer[7], Integer

Dim Statement

last updated 2017/11/21

to declare variables and allocates storage space for the specified variable name.

Syntax

Dim varname[([subscripts])][,varname[([subscripts])]]…
subscripts:  upperbound [,upperbound]…

Argument

DimRequired keyword. to indicate the start of Dim.varnameRequired. to specify the name of the variable following the standard variable naming conventions.(…)Optional, required if an array variable is specified. A pair of parenthetic brackets is needed to enclose subscripts.subscriptsOptional. to specify the dimensions of an array variable; up to 60 multiple dimensions may be declared.upperboundOptional, required if the declaration of the dimension of an array variable is needed . to specified the maximum index of a dimension of an array. While the lower bound of any dimension of an array is always zero.,Optional separator. to be used as delimiter when declaring multiple varname on same line or multiple dimensions of an array.

Remarks

  • Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.
  • The Dim statement can be used to declare a dynamic array with empty parentheses .
  • After declaring a dynamic array, use the ReDim statement within a procedure to define the number of dimensions and elements in the array.
  • An error occurs when trying to redeclare a dimension for an array variable whose size was explicitly specified in a Dim statement.

Requirement

1

ReDim Statement

last updated 2017/11/23

to declares dynamic-array variables, and allocates or reallocates storage space at procedure level.

Syntax

ReDim [Preserve] varname(subscripts) [, varname(subscripts)]…
subscripts:  upperbound [,upperbound]…

Argument

ReDimRequired keyword. to indicate the start of ReDim.PreserveOptional keyword. to preserves the data in an existing array when changing the size of the last dimension.varnameRequired. to specify the name of the variable following the standard variable naming conventions.(…)Required. A pair of parenthetic brackets is needed to enclose subscripts.subscriptsRequired. to specify the dimensions of an array variable; up to 60 multiple dimensions may be declared.upperboundRequired. to specified the maximum index of a dimension of an array. While the lower bound of any dimension of an array is always zero.,Optional separator. to be used as delimiter when declaring multiple varname on same line or multiple dimensions of an array.

Remarks

  • The ReDim statement is used to size or resize a dynamic array that has already been formally declared using a Private, Public, or Dim statement with empty parentheses (without dimension subscripts). The ReDim statement can be repeatedly used to change the number of elements and dimensions in an array.
  • If the Preserve keyword is used, only the last array dimension can be resized, the number of dimensions cannot be changed at all. For example, if your array has only one dimension, you can resize that dimension because it is the last and only dimension. However, if your array has two or more dimensions, you can change the size of only the last dimension and still preserve the contents of the array.
  • If making an array smaller than it was originally, data in the eliminated elements is lost.
  • A variable that refers to an object must be assigned an existing object using the Set statement before it can be used. Until it is assigned an object, the declared object variable has the special value Nothing.

Requirement

1

Examples

Examples of Dim Statement, ReDim Statement

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("abc","IsArray(abd)","UBound(abd)","abd(0)","abc1","abd1(0)")
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="Dim abc:abc=3+1":Execute vars:dsp_x
vars="Dim abd()":Execute vars:dsp_x
vars="ReDim abd(1):abd(0)=5":Execute vars:dsp_x
vars="ReDim Preserve abd(9)":Execute vars:dsp_x
vars="ReDim abd(9)":Execute vars:dsp_x
vars="Dim abc1:Dim abd1(1):abc1=9:Set abd1(0)=GetRef(""cmd_b"")":Execute vars: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
varsabc, TypeNameIsArray(abd), TypeNameUBound(abd), TypeNameabd(0), TypeNameabc1, TypeNameabd1(0), TypeNameDim abc:abc=3+1[4], Integer[False], Boolean[error], error[error], error[], Empty[error], errorDim abd()[4], Integer[True], Boolean[error], error[error], error[], Empty[error], errorReDim abd(1):abd(0)=5[4], Integer[True], Boolean[1], Long[5], Integer[], Empty[error], errorReDim Preserve abd(9)[4], Integer[True], Boolean[9], Long[5], Integer[], Empty[error], errorReDim abd(9)[4], Integer[True], Boolean[9], Long[], Empty[], Empty[error], errorDim abc1:Dim abd1(1):abc1=9:Set abd1(0)=GetRef("cmd_b")[4], Integer[True], Boolean[9], Long[], Empty[9], Integer[Object], Object

Erase Statement

last updated 2017/11/21

to reinitializes the elements of fixed-size arrays and to deallocate dynamic-array storage space.

Syntax

Erase array

Argument

EraseRequired keyword. To indicate the start of Erase.arrayRequired. To specify the name of the array variable to be erased.

Remarks

  • An array can be classified as fixed-size (ordinary) or dynamic. For fixed-size arrays,
  • Erase only resets the elements of a fixed array and recovers no memory.
  • For a fixed numeric array, Erase sets each element to zero.
  • For a fixed string array, Erase sets each element to zero-lenth string ("").
  • For an array of objects, Erase sets each element to the Nothing literal.
  • But for dynamic arrays, Erase frees the memory used by dynamic arrays. Therefore, the erased dynamic array must be redeclared again using a ReDim statement before the erased dynamic array can be refered again.

Requirement

1

Examples

Examples of Erase Statement

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("IsArray(dymarry)","UBound(dymarry)","dymarry(0)","IsArray(fixarry)","UBound(fixarry)","fixarry(0)")
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="Dim dymarry()":Execute vars:dsp_x
vars="ReDim dymarry(1):dymarry(0)=5":Execute vars:dsp_x
vars="Dim fixarry(1):fixarry(0)=8":Execute vars:dsp_x
vars="Erase dymarry":Execute vars:dsp_x
vars="Erase fixarry":Execute vars: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
varsIsArray(dymarry), TypeNameUBound(dymarry), TypeNamedymarry(0), TypeNameIsArray(fixarry), TypeNameUBound(fixarry), TypeNamefixarry(0), TypeNameDim dymarry()[True], Boolean[error], error[error], error[False], Boolean[error], error[error], errorReDim dymarry(1):dymarry(0)=5[True], Boolean[1], Long[5], Integer[False], Boolean[error], error[error], errorDim fixarry(1):fixarry(0)=8[True], Boolean[1], Long[5], Integer[True], Boolean[1], Long[8], IntegerErase dymarry[True], Boolean[error], error[error], error[True], Boolean[1], Long[8], IntegerErase fixarry[True], Boolean[error], error[error], error[True], Boolean[1], Long[], Empty

Private Statement

last updated 2017/11/23

to declares private variables and allocates storage space. Declares, in a Class block, a private variable.

Syntax

Private varname[([subscripts])][, varname[([subscripts])]]…
subscripts:  upper [, upper]…

Argument

PrivateRequired keyword. to indicate the start of Private statement.varnameRequired. to specify the name of the variable following standard variable naming conventions.subscriptsOptional. to specify the dimensions of an array variable; up to 60 multiple dimensions may be declared.upperOptional. to specify the upper boundary of an array. The lower bound of an array is always zero.

Remarks

  • Private statement variables are available only to the script in which they are declared.
  • A variable that refers to an object must be assigned an existing object using the Set statement before it can be used. Until it is assigned an object, the declared object variable is initialized as Empty.
  • The Private statement can also be used with empty parentheses to declare a dynamic array. After declaring a dynamic array, use the ReDim statement within a procedure to define the number of dimensions and elements in the array. If trying to redeclare a dimension for an array variable whose size was explicitly specified in a Private, Public, or Dim statement, an error occurs.
  • When using the Private statement in a procedure, the Private statement is generally put at the beginning of the procedure.

Requirement

1

Public Statement

last updated 2017/11/23

to declares public variables and allocates storage space. Declares, in a Class block, a public variable.

Syntax

Public varname[([subscripts])][, varname[([subscripts])]]…
subscripts:  upper [, upper]…

Argument

PublicRequired keyword. to indicate the start of Public statement.varnameRequired. to specify the name of the variable following standard variable naming conventions.subscriptsOptional. to specify the dimensions of an array variable; up to 60 multiple dimensions may be declared.upperOptional. to specify the upper boundary of an array. The lower bound of an array is always zero.

Remarks

  • Public statement variables are available to all procedures in all scripts.
  • A variable that refers to an object must be assigned an existing object using the Set statement before it can be used. Until it is assigned an object, the declared object variable is initialized as Empty.
  • The Public statement can be used with empty parentheses to declare a dynamic array. After declaring a dynamic array, use the ReDim statement within a procedure to define the number of dimensions and elements in the array. If trying to redeclare a dimension for an array variable whose size was explicitly specified in a Private, Public, or Dim statement, an error occurs.

Requirement

1

Examples

Examples of Private Statement, Public Statement

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("vg","TypeName(vg)","Private(vg)","Public(vg)")
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="Private va:vg=va":dsp_x
vars="Private vb():vg=vb":dsp_x
vars="Private vc(9):vg=vc":dsp_x
vars="Private vd, ve":vg=vd:dsp_x
vars="Set vf=GetRef(""cmd_b""):Private vf:Set vg=vf":dsp_x
vars="Private vg:Set vg=GetRef(""cmd_b"")":dsp_x
vars="Public va:vg=va":dsp_x
vars="Public vb():vg=vb":dsp_x
vars="Public vc(9):vg=vc":dsp_x
vars="Public vd, ve":vg=vd:dsp_x
vars="Set vf=GetRef(""cmd_b""):Public vf:Set vg=vf":dsp_x
vars="Public vg:Set vg=GetRef(""cmd_b"")":dsp_x
vars="Dim va:vg=va":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
varsvg, TypeNameTypeName(vg), TypeNamePrivate(vg), TypeNamePublic(vg), TypeNamePrivate va:vg=va[], Empty[Empty], String[error], error[error], errorPrivate vb():vg=vb[], Variant()[Variant()], String[error], error[error], errorPrivate vc(9):vg=vc["" "" "" "" "" "" "" "" "" ""], Variant()[Variant()], String[error], error[error], errorPrivate vd, ve[], Empty[Empty], String[error], error[error], errorSet vf=GetRef("cmd_b"):Private vf:Set vg=vf[Object], Object[Object], String[error], error[error], errorPrivate vg:Set vg=GetRef("cmd_b")[Object], Object[Object], String[error], error[error], errorPublic va:vg=va[], Empty[Empty], String[error], error[error], errorPublic vb():vg=vb[], Variant()[Variant()], String[error], error[error], errorPublic vc(9):vg=vc["" "" "" "" "" "" "" "" "" ""], Variant()[Variant()], String[error], error[error], errorPublic vd, ve[], Empty[Empty], String[error], error[error], errorSet vf=GetRef("cmd_b"):Public vf:Set vg=vf[Object], Object[Object], String[error], error[error], errorPublic vg:Set vg=GetRef("cmd_b")[Object], Object[Object], String[error], error[error], errorDim va:vg=va[], Empty[Empty], String[error], error[error], error

©sideway

ID: 180500002 Last Updated: 2018/5/2 Revision:

IMAGE

Home (5)

Business

Management

HBR (3)

Information

Recreation

Hobbies (7)

Culture

Chinese (1097)

English (336)

Reference (66)

Computer

Hardware (149)

Software

Application (187)

Digitization (24)

Numeric (19)

Programming

Web (648)new

CSS (SC)

ASP.NET (SC)

Regular Expression (SC)

HTML

Knowledge Base

Common Color (SC)

Html Entity (Unicode) (SC)

Html 401 Special (SC)

OS (389)

MS Windows

Windows10 (SC)

.NET Framework (SC)

DeskTop (7)

Knowledge

Mathematics

Formulas (8)

Number Theory (206)

Algebra (20)

Trigonometry (18)

Geometry (18)

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)

Biology (1)

Geography (1)


Copyright © 2000-2019 Sideway . All rights reserved Disclaimers last modified on 10 Feb 2019