Object. Property = Value
Syntax
To retrieve the value of a property, use this syntax:ReturnValue = Object. Property
Example
This example reads the date selected in a Calendar control, computes the shipping cost to deliver on that date, and then displays the calculated cost in a standard HTML text box:Sub ShipDate_Click() Dim shiptime shiptime = ShipDate.Value - Date If shiptime < 0 Then MsgBox "Can't ship before today" ElseIf shiptime < 5 Then frmShip.txtCost.Value = 12 Else frmShip.txtCost.Value = 8 End If End Sub
[Call] Object. Method
Example
This example calls the Today method of the Calendar control when a user clicks the Reset button:Sub Reset_OnClick() call ShipDate.Today() End Sub
The Call keyword is optional. If you specify Call , you must enclose the arguments in parentheses.
You can use VBScript to set properties and methods of ActiveX controls and Java applets that are contained within an HTML page. VBScript features sub procedures and function procedures, and it supports the use of variables such as data types, arrays, scope, and constants. VBScript also supports most of the Visual Basic for Applications structures for controlling program flow. Just as in traditional Visual Basic applications, you can include error handling scripts on a Web page. Using script, you can also control objects and respond to events.