output.to from Sideway

Draft for Information Only

# Content

``` VBScript Math Functions Sin Function  Syntax  Argument  Returns  Remarks  Requirement vbSingle  Returns  Requirement Cos Function  Syntax  Argument  Returns  Remarks  Requirement Examples GetStandardStream Method  Syntax  Argument  Settings Tan Function  Syntax  Argument  Returns  Remarks  Requirement vbBinaryCompare Constant  Returns  Requirement vbBlack Constant  Returns  Remarks  Requirement vbBlue Constant  Returns  Remarks  Requirement vbCyan Constant  Returns  Remarks  Requirement vbFirstFourDays Constant  Returns  Requirement vbFirstFullWeek Constant  Returns  Requirement vbFirstJan1 Constant  Returns  Requirement vbFriday Constant  Returns  Requirement vbGeneralDate Constant  Returns  Requirement vbGreen Constant  Returns  Remarks  Requirement vbLongDate Constant  Returns  Requirement vbLongTime Constant  Returns  Requirement vbMagenta Constant  Returns  Remarks  Requirement vbMonday Constant  Returns  Requirement vbObjectError Constant  Returns  Requirement vbOKOnly Constant  Returns  Requirement vbRed Constant  Returns  Remarks  Requirement vbSaturday Constant  Returns  Requirement vbShortDate Constant  Returns  Requirement vbShortTime Constant  Returns  Requirement vbSunday Constant  Returns  Requirement vbTextCompare Constant  Returns  Requirement vbThursday Constant  Returns  Requirement vbTuesday Constant  Returns  Requirement vbUseSystem Constant  Returns  Requirement vbUseSystemDayOfWeek Constant  Returns  Requirement vbWednesday Constant  Returns  Requirement vbWhite Constant  Returns  Remarks  Requirement vbYellow Constant  Returns  Remarks  Requirement Atn Function  Syntax  Argument  Returns  Remarks  Requirement Examples   Sources```

# VBScript Math Functions

Functions for manipulating mathematics expression.

## Sin Function

last updated 2017/9/21

Converts a given number to the sine of the given number by taking the given number as an angle in radian.

### Syntax

`Sin(number)`

### Argument

numberRequired. Any valid numeric expression that expresses an angle in radians.

### Returns

Returns a Variant of Double data subtype containing the sine, sin function of a given number.

Special returns of Sin function:

numberreturn valueNullRun-time ErrorEmpty0""Run-time Error

### Remarks

• Sin function is a trigonometric sine function.
• The given number argument is defined as the angle of a right triangle to which the ratio of opposite side length and hypotenuse side length of the right triangle is equal to the sine function of the given angle.
• Radians of a specified angle given in degrees can be obtained by multipling degrees by π/180.
• The range of return is -1≤sin θ≤1.

1

## vbSingle

last updated 2017/11/26

to specify a Single subtype

4

2

## Cos Function

last updated 2017/9/17

Converts a given number to the cosine of the given number by taking the given number as an angle in radian.

### Syntax

`Cos(number)`

### Argument

numberRequired. Any valid numeric expression that expresses an angle in radians.

### Returns

Returns a Variant of Double data subtype containing the cosine, cos function of a given number .

Special returns of Cos function:

numberreturn valueNullRun-time ErrorEmpty1""Run-time Error

### Remarks

• Cos function is a trigonometric cosine function.
• The given number argument is defined as the angle of a right triangle to which the ratio of adjacent side length and hypotenuse side length of the right triangle is equal to the cosine function of the given angle.
• Radians of a specified angle given in degrees can be obtained by multipling degrees by π/180.
• The range of return is -1≤cos θ≤1.

1

## Examples

Examples of Sin, Cos, Tan functions

ASP VbScript Command:
``````<script runat="server" language="VBScript">
Dim vars,num,pi,cmda,var:pi=4*Atn(1):var=0
Response.Write "π≈pi=4*Atn(1)="&pi&"<br /><br />"
cmda=array("num","Sin(num)","Cos(num)","Tan(num)")
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="num=Empty":dsp_x
vars="num=0":dsp_x
vars="num=pi/4":dsp_x
vars="num=-pi/4":dsp_x
vars="num=pi/2":dsp_x
vars="num=-pi/2":dsp_x
vars="num=pi":dsp_x
vars="num=-pi":dsp_x
</script>
``````
HTML Web Page In-line Output:
π≈pi=4*Atn(1)=3.14159265358979

Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /sideway/default.asp
varsnum, TypeNameSin(num), TypeNameCos(num), TypeNameTan(num), TypeNamenum=Empty[], Empty[0], Double[1], Double[0], Doublenum=0[0], Integer[0], Double[1], Double[0], Doublenum=pi/4[.785398163397448], Double[.707106781186547], Double[.707106781186548], Double[1], Doublenum=-pi/4[-.785398163397448], Double[-.707106781186547], Double[.707106781186548], Double[-1], Doublenum=pi/2[1.5707963267949], Double[1], Double[6.12323399573677E-17], Double[1.63312393531954E+16], Doublenum=-pi/2[-1.5707963267949], Double[-1], Double[6.12323399573677E-17], Double[-1.63312393531954E+16], Doublenum=pi[3.14159265358979], Double[1.22464679914735E-16], Double[-1], Double[-1.22464679914735E-16], Doublenum=-pi[-3.14159265358979], Double[-1.22464679914735E-16], Double[-1], Double[1.22464679914735E-16], Double

## GetStandardStream Method

last updated 2017/12/14

is to return a standard TextStream Object according to the given standardStreamType setting and specified optional unicode setting.

### Syntax

`fsoobjvar.GetStandardStream(standardStreamType [, unicode ])`

### Argument

fsoobjvarRequired. to specify the associated Object instance reference.GetStandardStreamRequired Keyword. to specify the Method of associated Object.standardStreamTypeRequired. Can be one of three constants: StdErr, StdIn, or StdOut.unicodeOptional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is true if the file is created as a Unicode file, false if it is created as an ASCII file. If omitted, an ASCII file is assumed.

### Settings

standardStreamType argument:

ConstantValueDescriptionStdIn0Returns a TextStream object corresponding to the standard input stream.StdOut1Returns a TextStream object corresponding to the standard output stream.StdErr2Returns a TextStream object corresponding to the standard error stream.

## Tan Function

last updated 2017/9/21

Converts a given number to the tangent of the given number by taking the given number as an angle in radian.

### Syntax

`Tan(number)`

### Argument

numberRequired. Any valid numeric expression that expresses an angle in radians.

### Returns

Returns a Variant of Double data subtype containing the tangent, tan function of a given number.

Special returns of Tan function:

numberreturn valueNullRun-time ErrorEmpty0""Run-time Error

### Remarks

• Tan function is a trigonometric tangent function.
• The given number argument is defined as the angle of a right triangle to which the ratio of opposite side length and adjacent side length of the right triangle is equal to the tangent function of the given angle.
• Radians of a specified angle given in degrees can be obtained by multipling degrees by π/180.
• The range of return is –∞<tan θ<<∞.

1

## vbBinaryCompare Constant

last updated 2017/11/25

to perform a binary comparison

0

2

## vbBlack Constant

last updated 2017/11/25

Color Black

&h00

### Remarks

• Decimal Value: 0

2

## vbBlue Constant

last updated 2017/11/25

Color Blue

&hFF0000

### Remarks

• Decimal Value: 16711680

2

## vbCyan Constant

last updated 2017/11/25

Color Cyan

&hFFFF00

### Remarks

• Decimal Value: 16776960

2

## vbFirstFourDays Constant

last updated 2017/11/25

to use the first week that has at least four days in the new year as the first week of the year..

2

2

## vbFirstFullWeek Constant

last updated 2017/11/25

to use the first full week of the new year as the first week of the year.

3

2

## vbFirstJan1 Constant

last updated 2017/11/25

to use the week in which January 1 occurs as the first week of the year.

1

2

## vbFriday Constant

last updated 2017/11/25

Friday

6

2

## vbGeneralDate Constant

last updated 2017/11/25

to display a date and/or time using the GeneralDate format specified in local computer's system settings. For real numbers, display a date and time. If there is no fractional part, display only a date. If there is no integer part, display time only.

0

2

## vbGreen Constant

last updated 2017/11/25

Color Green

&hFF00

### Remarks

• Decimal Value: 65280

2

## vbLongDate Constant

last updated 2017/11/25

to display a date using the LongDate format specified in local computer's regional settings.

1

2

## vbLongTime Constant

last updated 2017/11/25

to display a date using the LongTime format specified in local computer's regional settings.

3

2

## vbMagenta Constant

last updated 2017/11/25

Color Magenta

&hFF00FF

### Remarks

• Decimal Value: 16711935

2

## vbMonday Constant

last updated 2017/11/25

Monday

2

2

## vbObjectError Constant

last updated 2017/11/25

the reference value for creating user-defined error numbers which should be greater than this value.

-2147221504

2

## vbOKOnly Constant

last updated 2017/11/25

to display OK button only.

0

2

## vbRed Constant

last updated 2017/11/25

Color Red

&hFF

### Remarks

• Decimal Value: 255

2

## vbSaturday Constant

last updated 2017/11/25

Saturday

7

2

## vbShortDate Constant

last updated 2017/11/25

to display a date using the ShortDate format specified in local computer's regional settings.

2

2

## vbShortTime Constant

last updated 2017/11/25

to display a date using the ShortTime format specified in local computer's regional settings.

4

2

## vbSunday Constant

last updated 2017/11/25

Sunday

1

2

## vbTextCompare Constant

last updated 2017/11/25

to perform a text comparison

1

2

## vbThursday Constant

last updated 2017/11/25

Thursday

5

2

## vbTuesday Constant

last updated 2017/11/25

Tuesday

3

2

## vbUseSystem Constant

last updated 2017/11/25

to use National Language Support (NLS) API setting as the first week of the year..

0

2

## vbUseSystemDayOfWeek Constant

last updated 2017/11/25

to use the day of the week specified in local system settings as the first day of the week.

0

2

## vbWednesday Constant

last updated 2017/11/25

Wednesday

4

2

## vbWhite Constant

last updated 2017/11/25

Color White

&hFFFFFF

### Remarks

• Decimal Value: 16777215

2

## vbYellow Constant

last updated 2017/11/25

Color Yellow

&hFFFF

### Remarks

• Decimal Value: 65535

2

## Atn Function

last updated 2017/9/16

Converts a given number to an angle in radian by taking the inverse trigonometric function of tangent function of the given number.

### Syntax

`Atn(number)`

### Argument

numberRequired. Any valid numeric expression

### Returns

Returns a Variant of Double data subtype containing the arctangent, arctan function of a given number.

Special returns of Atn function:

numberreturn valueNullRun-time ErrorEmpty0""Run-time Error

### Remarks

• Atn function is a trigonometric arctangent function.
• Atn function is the inverse trigonometric function of tangent function. While the inverse of a tangent function, 1/tan, is equal to the cotangent function.
• The given number is defined as the ratio of opposite side length and adjacent side length of a right triangle with an unknown angle and is equal to the arctangent function of the unknown angle.
• Degrees of the returned angle can be obtained by multipling radians by 180/π.
• The range of return is -π/2<arctan x<π.2.

1

## Examples

Examples of Atn functions

ASP VbScript Command:
``````<script runat="server" language="VBScript">
Dim vars,num,pi,cmda,var:pi=4*Atn(1):var=0
Response.Write "π≈pi=4*Atn(1)="&pi&"<br /><br />"
cmda=array("num","Atn(num)")
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="num=Empty":dsp_x
vars="num=0":dsp_x
vars="num=1":dsp_x
vars="num=-1":dsp_x
vars="num=1.633E+16":dsp_x
vars="num=-1.633E+16":dsp_x
</script>
``````
HTML Web Page In-line Output:
π≈pi=4*Atn(1)=3.14159265358979

Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /sideway/default.asp
varsnum, TypeNameAtn(num), TypeNamenum=Empty[], Empty[0], Doublenum=0[0], Integer[0], Doublenum=1[1], Integer[.785398163397448], Doublenum=-1[-1], Integer[-.785398163397448], Doublenum=1.633E+16[1.633E+16], Double[1.5707963267949], Doublenum=-1.633E+16[-1.633E+16], Double[-1.5707963267949], Double

### Sources

•

ID: 170900026 Last Updated: 2017/11/6 Revision: 2

Home (5)

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 (602)

CSS (SC)

ASP.NET (SC)

HTML

Knowledge Base

Common Color (SC)

Html 401 Special (SC)

OS (373)

MS Windows

Windows10 (SC)

.NET Framework (SC)

DeskTop (6)

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)

Control

Acoustics (19)

Biology (1)

Geography (1)