Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=180400001

Script, Scripting Language, VBScript elements, Server-Side VBScript Function Asc, Chr, AscB, ChrB, AscW, ChrW Function

VBScript String Functions

Functions for manipulating string expression.

Asc Function

last updated 9/16/2017

Create an ANSI character code number from the first character of a given string by encoding the first character of the given string as the associated ANSI character of the ANSI character code.

Syntax

Asc(string)

Argument

stringRequired. Any valid expression that is used as the associated ANSI character.

Returns

Returns a Variant of Integer data subtype containing a ANSI character code number converted from the first character of a given string by encoding the first character of the given string as the associated ANSI character of the ANSI character code.

Returns of function:

stringreturn valueValid ANSI character Valid associated ANSI Character codeacceptable charactera ANSI character character numberInvalid expressionRun-time error

Special returns of function:

charcodereturn valueNullRun-time errorEmptyRun-time error""Run-time error

Remarks

  • Asc function is used to create an ANSI character code by encoding the first character of the given string as the associated ANSI character of the ANSI character code.
  • Asc function returns only the ANSI character code of the first character of a given string.
  • The string argument can be any valid string but Asc function always returns a character code between 0 and 255 inclusive.
  • However, the Asc function can usually return the correct ASCII character code for the character with character code between 0 and 127 only.
  • The AscB function is used with byte data contained in a string. Instead of returning the character code for the first character, AscB returns the first byte. AscW is provided for 32-bit platforms that use Unicode characters. It returns the Unicode (wide) character code, thereby avoiding the conversion from Unicode to ANSI.

Requirement

1

Chr Function

last updated 9/16/2017

Create an ANSI character string from a given charcode by evaluating the given charcode as the ANSI character code of the associated character.

Syntax

Chr(charcode)

Argument

charcodeRequired. Any valid numeric expression that is used as the ANSI character code.

Returns

Returns a Variant of String data subtype containing an associated ANSI character string converted from a given charcode by evaluating the given charcode as the ANSI character code of the associated ANSI character.

Returns of function:

charcodereturn valueValid ANSI character codeValid associated ANSI Characteracceptable numeric numbera single character stringInvalid charcodeRun-time error

Special returns of function:

charcodereturn valueNullRun-time errorEmptyNUL control character ""Run-time error

Remarks

  • Chr function is used to create an ANSI character by evaluating the given charcode as the ANSI character code of the associated ANSI character.
  • Chr function always returns a single character String.
  • charcode argument between 0 and 31 inclusive, and 127 are non-printable ASCII character code which are not supported by Windows. For example Chr(0) return a character "NUL".
  • charcode argument between 32 and 126 inclusive are printable ASCII character code. For example Chr(55) return a character "7".
  • charcode argument between 128 and 255 inclusive are sometimes called Extended ASCII character code but not exactly. These character codes may associated with othe characters or are not supported by Windows For example, charcode 128, 129, 141, 142, 143, 144, 157, 158 are not supported by Windows.
  • However, the Chr function can usually return the correct ASCII character for the character code between 0 and 127 only.
  • The ChrB function is used with byte data contained in a string. Instead of returning a character, which may be one or two bytes, ChrB always returns a single byte. ChrW is provided for 32-bit platforms that use Unicode characters. Its argument is a Unicode (wide) character code, thereby avoiding the conversion from ANSI to Unicode.

Requirement

1

Examples

Examples of Chr and Asc functions

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("strs","Chr(strs)","Asc(strs)")
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 /internet/users/sideblog/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="strs=Null":dsp_x
vars="strs=Empty":dsp_x
vars="strs=array(1,2)":dsp_x
vars="Set strs = ObjectContext":dsp_x
vars="strs=""""":dsp_x
vars="strs="" """:dsp_x
vars="strs=""  """:dsp_x
vars="strs=0":dsp_x
vars="strs=32":dsp_x
vars="strs=55":dsp_x
vars="strs=125":dsp_x
vars="strs=126":dsp_x
vars="strs=127":dsp_x
vars="strs=128":dsp_x
vars="strs=132":dsp_x
vars="strs=255":dsp_x
vars="strs=chr(0)":dsp_x
vars="strs=chr(77)":dsp_x
vars="strs=chr(127)":dsp_x
vars="strs=chr(128)":dsp_x
vars="strs=chr(161)":dsp_x
vars="strs=chr(255)":dsp_x
vars="strs=chrW(128)":dsp_x
vars="strs=chrW(161)":dsp_x
vars="strs=chrW(255)":dsp_x
vars="strs=254":dsp_x
vars="strs=2":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 /internet/users/sideblog/default.asp
varsstrs, TypeNameChr(strs), TypeNameAsc(strs), TypeNamestrs=Null[], Null[error], error[error], errorstrs=Empty[], Empty[NUL], String[error], errorstrs=array(1,2)['1' '2'], Variant()[error], error[error], errorSet strs = ObjectContext[IASPObjectContext], IASPObjectContext[error], error[error], errorstrs=""[], String[error], error[error], errorstrs=" "[ ], String[error], error[32], Integerstrs="  "[  ], String[error], error[32], Integerstrs=0[0], Integer[NUL], String[48], Integerstrs=32[32], Integer[ ], String[51], Integerstrs=55[55], Integer[7], String[53], Integerstrs=125[125], Integer[}], String[49], Integerstrs=126[126], Integer[~], String[49], Integerstrs=127[127], Integer[DEL], String[49], Integerstrs=128[128], Integer[€], String[49], Integerstrs=132[132], Integer[„], String[49], Integerstrs=255[255], Integer[ÿ], String[50], Integerstrs=chr(0)[NUL], String[error], error[0], Integerstrs=chr(77)[M], String[error], error[77], Integerstrs=chr(127)[DEL], String[error], error[127], Integerstrs=chr(128)[€], String[error], error[128], Integerstrs=chr(161)[¡], String[error], error[161], Integerstrs=chr(255)[ÿ], String[error], error[255], Integerstrs=chrW(128)[€], String[error], error[63], Integerstrs=chrW(161)[¡], String[error], error[161], Integerstrs=chrW(255)[ÿ], String[error], error[255], Integerstrs=254[254], Integer[þ], String[50], Integerstrs=2[2], Integer[STX], String[50], Integer

AscB Function

last updated 9/16/2017

Create a Byte from the first byte of the character code of first character of a given string.

Syntax

AscB(string)

Argument

stringRequired. Any valid expression that is used for evaluating the first byte of the character code of the first character.

Returns

Returns a Variant of Byte data subtype containing a Byte obtained from the first byte of the character code of first character of a given string.

Special returns of function:

charcodereturn valueNullRun-time errorEmptyRun-time error""Run-time error

Remarks

  • AscB function is used to return the first Byte of the first character of a given string.
  • The string argument can be any valid string but AscB function always returns the first Byte of the first character only.
  • Because of the widely use of Unicode, the need of using AscB function is rarely and sometimes the AscB function may produce different results on different operating systems.
  • However, the behavior of VBScript functions such as MidB, ChrB, LeftB, LenB, ChrB and AscB depends on the byte ordering of the hardware platform, and the number of bytes used to represent Unicode characters in the system software. The functions may produce different results on different operating systems.
  • The AscB function is used with byte data contained in a string. Instead of returning the character code for the first character, AscB returns the first byte. AscW is provided for 32-bit platforms that use Unicode characters. It returns the Unicode (wide) character code, thereby avoiding the conversion from Unicode to ANSI.

Requirement

1

AscW Function

last updated 9/16/2017

Create a decimal Unicode (wide) character code from the character code of first character of a given string.

Syntax

AscW(string)

Argument

stringRequired. Any valid expression that is used for evaluating the character code of the first character.

Returns

Returns a Variant of Integer data subtype containing a number obtained from the decimal Unicode (wide) character code of first character of a given string.

Special returns of function:

charcodereturn valueNullRun-time errorEmptyRun-time error""Run-time error

Remarks

  • AscW function is used to return decimal Unicode (wide) character code of the first character of a given string.
  • The string argument can be any valid string but AscW function always returns the first decimal Unicode (wide) character code of the first character only.
  • However, the behavior of VBScript functions such as MidW, ChrW, LeftW, and AscW sometimes also depends on the hardware platform, and the number of bytes used to represent Unicode characters in the system software. The functions may produce different results on different operating systems.
  • The AscB function is used with byte data contained in a string. Instead of returning the character code for the first character, AscB returns the first byte. AscW is provided for 32-bit platforms that use Unicode characters. It returns the Unicode (wide) character code, thereby avoiding the conversion from Unicode to ANSI.

Requirement

1

Examples

Examples of Chr and Asc functions

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("strs","Asc(strs)","AscB(strs)","AscW(strs)")
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 /internet/users/sideblog/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="strs=Null":dsp_x
vars="strs=Empty":dsp_x
vars="strs=""""":dsp_x
vars="strs=Hex(95)"&":strs=Unescape(""%""&strs)":dsp_x
vars="strs=Hex(111)"&":strs=Unescape(""%""&strs)":dsp_x
vars="strs=Hex(127)"&":strs=Unescape(""%""&strs)":dsp_x
vars="strs=Hex(143)"&":strs=Unescape(""%""&strs)":dsp_x
vars="strs=Hex(255)"&":strs=Unescape(""%""&strs)":dsp_x
vars="strs=Hex(256+95)"&":strs=Unescape(""%u0""&strs)":dsp_x
vars="strs=Hex(256+111)"&":strs=Unescape(""%u0""&strs)":dsp_x
vars="strs=Hex(256+127)"&":strs=Unescape(""%u0""&strs)":dsp_x
vars="strs=Hex(256+143)"&":strs=Unescape(""%u0""&strs)":dsp_x
vars="strs=Hex(256++255)"&":strs=Unescape(""%u0""&strs)":dsp_x
vars="strs=Unescape(""%u015F"")":dsp_x
vars="strs=Unescape(""%u016F"")":dsp_x
vars="strs=Unescape(""%u017F"")":dsp_x
vars="strs=Unescape(""%u018F"")":dsp_x
vars="strs=Unescape(""%u01FF"")":dsp_x
vars="strs=""ůş""":dsp_x
vars="strs=""🄗""":dsp_x
vars="strs=""𠃊""":dsp_x
vars="strs=Unescape(""%uD83C%uDD17"")":dsp_x
vars="strs=Unescape(""%uD840%uDCCA"")":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 /internet/users/sideblog/default.asp
varsstrs, TypeNameAsc(strs), TypeNameAscB(strs), TypeNameAscW(strs), TypeNamestrs=Null[], Null[error], error[error], error[error], errorstrs=Empty[], Empty[error], error[error], error[error], errorstrs=""[], String[error], error[error], error[error], errorstrs=Hex(95):strs=Unescape("%"&strs)[_], String[95], Integer[95], Byte[95], Integerstrs=Hex(111):strs=Unescape("%"&strs)[o], String[111], Integer[111], Byte[111], Integerstrs=Hex(127):strs=Unescape("%"&strs)[DEL], String[127], Integer[127], Byte[127], Integerstrs=Hex(143):strs=Unescape("%"&strs)[], String[143], Integer[143], Byte[143], Integerstrs=Hex(255):strs=Unescape("%"&strs)[ÿ], String[255], Integer[255], Byte[255], Integerstrs=Hex(256+95):strs=Unescape("%u0"&strs)[ş], String[115], Integer[95], Byte[351], Integerstrs=Hex(256+111):strs=Unescape("%u0"&strs)[ů], String[117], Integer[111], Byte[367], Integerstrs=Hex(256+127):strs=Unescape("%u0"&strs)[ſ], String[63], Integer[127], Byte[383], Integerstrs=Hex(256+143):strs=Unescape("%u0"&strs)[Ə], String[63], Integer[143], Byte[399], Integerstrs=Hex(256++255):strs=Unescape("%u0"&strs)[ǿ], String[63], Integer[255], Byte[511], Integerstrs=Unescape("%u015F")[ş], String[115], Integer[95], Byte[351], Integerstrs=Unescape("%u016F")[ů], String[117], Integer[111], Byte[367], Integerstrs=Unescape("%u017F")[ſ], String[63], Integer[127], Byte[383], Integerstrs=Unescape("%u018F")[Ə], String[63], Integer[143], Byte[399], Integerstrs=Unescape("%u01FF")[ǿ], String[63], Integer[255], Byte[511], Integerstrs="ůş"[ůş], String[117], Integer[111], Byte[367], Integerstrs="🄗"[🄗], String[63], Integer[60], Byte[-10180], Integerstrs="𠃊"[𠃊], String[63], Integer[64], Byte[-10176], Integerstrs=Unescape("%uD83C%uDD17")[🄗], String[63], Integer[60], Byte[-10180], Integerstrs=Unescape("%uD840%uDCCA")[𠃊], String[63], Integer[64], Byte[-10176], Integer

ChrB Function

last updated 9/16/2017

Create a character string from a given charcode by evaluating the given charcode as the Byte code of the associated character.

Syntax

ChrB(charcode)

Argument

charcodeRequired. Any valid numeric expression that is used as the Byte code.

Returns

Returns a Variant of String data subtype containing a character string converted from a given charcode by evaluating the given charcode as the Byte code of the associated character.

Special returns of function:

charcodereturn valueNullRun-time errorEmptyNUL control character "Run-time error

Remarks

  • ChrB function is used to create a character by evaluating the given charcode as the Byte code of the associated character.
  • ChrB function always returns a single character String.
  • Because of the widely use of Unicode, the need of using ChrB function is rarely and sometimes the ChrB function may produce different results on different operating systems.
  • However, the behavior of VBScript functions such as MidB, ChrB, LeftB, LenB, ChrB and AscB depends on the byte ordering of the hardware platform, and the number of bytes used to represent Unicode characters in the system software. The functions may produce different results on different operating systems.
  • The ChrB function is used with byte data contained in a string. Instead of returning the character for the character code, ChrB returns the character for the Byte code. ChrW is provided for 32-bit platforms that use Unicode characters with the Unicode (wide) character code, thereby avoiding the conversion from ANSI to Unicode.

Requirement

1

ChrW Function

last updated 9/16/2017

Create a character string from a given charcode by evaluating the given charcode as the Unicode (wide) character code or Unicode/DBCS of the associated Unicode character.

Syntax

ChrW(charcode)

Argument

charcodeRequired. Any valid numeric expression that is used as the Unicode (wide) character code or Unicode/DBCS.

Returns

Returns a Variant of String data subtype containing a character string converted from a given charcode by evaluating the given charcode as the the Unicode (wide) character code or Unicode/DBCS of the associated Unicode character.

Special returns of function:

charcodereturn valueNullRun-time errorEmptyNUL control character "Run-time error

Remarks

  • ChrW function is used to create a character by evaluating the given charcode as the Unicode (wide) character code or Unicode/DBCS of the associated character.
  • ChrW function always returns a single character String.
  • However, the behavior of VBScript functions such as MidW, ChrW, LeftW, and AscW sometimes also depends on the hardware platform, and the number of bytes used to represent Unicode characters in the system software. The functions may produce different results on different operating systems.
  • The ChrB function is used with byte data contained in a string. Instead of returning the character for the character code, ChrB returns the character for the Byte code. ChrW is provided for 32-bit platforms that use Unicode characters with the Unicode (wide) character code, thereby avoiding the conversion from ANSI to Unicode.

Requirement

1

Examples

Examples of Chr and Asc functions

ASP VbScript Command:
<script runat="server" language="VBScript">
Dim vars,strs,cmda
cmda=array("strs","Chr(strs)","ChrB(strs)","AscB(ChrB(strs))","ChrW(strs)")
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 /internet/users/sideblog/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="strs=Null":dsp_x
vars="strs=Empty":dsp_x
vars="strs=""""":dsp_x
vars="strs=""95""":dsp_x
vars="strs=111":dsp_x
vars="strs=127":dsp_x
vars="strs=143":dsp_x
vars="strs=253":dsp_x
vars="strs=256+95":dsp_x
vars="strs=256+111":dsp_x
vars="strs=256+127":dsp_x
vars="strs=256+143":dsp_x
vars="strs=256+255":dsp_x
vars="strs=-32259":dsp_x
vars="strs=32257":dsp_x
vars="strs=32258":dsp_x
vars="strs=65536":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 /internet/users/sideblog/default.asp
varsstrs, TypeNameChr(strs), TypeNameChrB(strs), TypeNameAscB(ChrB(strs)), TypeNameChrW(strs), TypeNamestrs=Null[], Null[error], error[error], error[error], error[error], errorstrs=Empty[], Empty[NUL], String[], String[0], Byte[NUL], Stringstrs=""[], String[error], error[error], error[error], error[error], errorstrs="95"[95], String[_], String[], String[95], Byte[_], Stringstrs=111[111], Integer[o], String[], String[111], Byte[o], Stringstrs=127[127], Integer[DEL], String[], String[127], Byte[DEL], Stringstrs=143[143], Integer[], String[], String[143], Byte[], Stringstrs=253[253], Integer[ý], String[], String[253], Byte[ý], Stringstrs=256+95[351], Integer[SOH], String[error], error[error], error[ş], Stringstrs=256+111[367], Integer[SOH], String[error], error[error], error[ů], Stringstrs=256+127[383], Integer[SOH], String[error], error[error], error[ſ], Stringstrs=256+143[399], Integer[SOH], String[error], error[error], error[Ə], Stringstrs=256+255[511], Integer[SOH], String[error], error[error], error[ǿ], Stringstrs=-32259[-32259], Integer[], String[error], error[error], error[臽], Stringstrs=32257[32257], Integer[~], String[error], error[error], error[縁], Stringstrs=32258[32258], Integer[~], String[error], error[error], error[縂], Stringstrs=65536[65536], Long[error], error[error], error[error], error[error], error

Sideway BICK Blog

01/04


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013