18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

RGB<br />

Description Returns a whole number representing an RGB color value<br />

Usage intVal = RGB(red, green, blue)<br />

Arguments red<br />

Required. Number in the range 0-255 representing the red component of the color.<br />

green<br />

Required. Number in the range 0-255 representing the green component of the color.<br />

blue<br />

Required. Number in the range 0-255 representing the blue component of the color.<br />

Remarks Application methods and properties that accept a color specification expect that specification to<br />

be a number representing an RGB color value. An RGB color value specifies the relative intensity<br />

of red, green, and blue to cause a specific color to be displayed. The low-order byte contains the<br />

value <strong>for</strong> red, the middle byte contains the value <strong>for</strong> green, and the high-order byte contains the<br />

value <strong>for</strong> blue. A runtime error occurs if any of the arguments cannot be evaluated to a numeric<br />

value.<br />

For applications that require the byte order to be reversed, the following function will provide the<br />

same in<strong>for</strong>mation with the bytes reversed:<br />

Function RevRGB(red, green, blue)<br />

RevRGB= CLng(blue + (green * 256) + (red * 65536))<br />

End Function<br />

Example MyColor = RGB(130, 155, 204)<br />

Right<br />

Description Returns length number of characters from the right side of a string<br />

Usage strVal = Right(string, length)<br />

Arguments string<br />

String expression from which the characters are extracted from.<br />

length<br />

Numeric expression indicating how many characters to return (extract).<br />

Remarks If string contains Null, Null is returned. If length is 0, a zero-length string("") is returned. If length<br />

is greater than or equal to the number of characters in string, the entire string is returned. To<br />

determine the number of characters in the string, use the Len function.<br />

See Also Left, LeftB, Len, LenB, Mid, MidB, RightB<br />

Example The following example uses the Right function to return a specified number of characters from<br />

the right side of a string:<br />

Dim AnyString, MyStr<br />

AnyString = "Hello World" 'Define string<br />

MyStr = Right(AnyString, 1) 'Returns "d"<br />

MyStr = Right(AnyString, 6) 'Returns " World"<br />

MyStr = Right(AnyString, 20) 'Returns "Hello World"<br />

RightB<br />

Description Returns length number of bytes from the right side of a string<br />

Usage strVal = Right(string, length)<br />

Arguments string<br />

String expression from which the bytes are extracted from.<br />

length<br />

Numeric expression indicating how many bytes to return (extract).<br />

Remarks If string contains Null, Null is returned. If length is 0, a zero-length string("") is returned. If length<br />

is greater than or equal to the number of bytes in the string, the entire string is returned. To<br />

determine the number of bytes in the string, use the LenB function.<br />

See Also Left, LeftB, Len, LenB, Mid, MidB, Right<br />

<strong>InduSoft</strong>, Ltd. 153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!