Other Statements & Functions

 

 

Function

What It Does

Comments

Beep

Generates a beep

Call name [arguments]

Runs a sub, function, or DLL (procedure)

name is the name of the procedure; arguments are an optional list of comma-delimited parameters to be passed to the procedure. Keywords ByVal or ByRef can be used, but only when calling a DLL procedure

Command()

Returns any command-line arguments specified when launching the VB interpreter (F5 operation). For compiled programs, Command returns the command-line arguments specified when the program is launched

 

CreateObject(class)

Creates and returns a reference to an ActiveX object of type class.

 

class uses the syntax appname.objecttype, where appname is the name of the application providing the object, and objecttype is the class of the object to be created.

Environ(envstring|number)

Returns the String value of the operating system variable envstring or the numeric order of the environment string in the environment-string table specified by number.

If envstring can't be found in the environment string table, a zero length string will be returned.

object.GetAutoServerSettings _

([progid], [clsid])

Returns a Variant array containing information concerning the state of an ActiveX object's registration..

 

(optional) progid and clsid specify the object's ProgID and CLSID, respectively. The elements of the Variant array that are returned by GetAutoServerSettings are, in order:

 

  • local/remote registration of object (True if the object is registered remotely) the remote machine name,
  • the RPC network protocol name, and
  • the RPC authentication level

GetObject([pathname][,class])

Returns a reference to an object of type class.

pathname specifies the path and filename from which the object should be retrieved; however, if it's omitted, the class name must be specified.

Input(number, [#]filenumber)

Returns a String containing characters read in from the open file that corresponds to filenumber.

The number of characters read in is specified by the number argument. This function is only used with Input or Binary files.

InputBox()

See InputBox Page

Format()

See Format Page

[Let]varname = expression

Not really used much if at all any more

MsgBox()

See MsgBox Page

RaiseEvent eventname [(argumentlist)]

Triggers an event.

 

(optional) argumentlist specifies one or more comma-delimited arguments to be passed to the event procedure. The event procedure must be declared in the same module as the RaiseEvent function or an error occurs.

RGB(red, green,blue)

Returns a Long representing an RGB color value as specified by the red, green, and blue color parameters.

 

SendKeys string[, wait]

Generates one or more keystrokes as if they came from the keyboard

string determines which keystrokes to send, and (optional) wait, a Boolean, specifies whether keystrokes must be processed before control is returned to the procedure. False, the default, forces control to be returned to the procedure after the keystrokes are sent.

Set objectvar = {[New] _ objectexpression|Nothing}

Assigns an object reference (objectexpression) to a variable or property (objectvar). 

(optional) New is used to indicate the object should be created implicitly. To disassociate objectvar with a specific object and free up the resources it's using, assign it the Nothing keyword.

Shell(pathname[, windowstyle])

Runs the executable program specified by the pathname argument and returns a Variant representing the program's task ID. 

If Shell is unsuccessful, it returns zero. The (optional) windowstyle determines the style of the window in which the shelled program runs.

Spc(n)

Inserts n spaces when writing or displaying text using the Print # statement or the Print method.

 

Tab(n)

Positions output to the nth column when writing or displaying text using the Print # statement or the Print method.

 

VarType(varname)

Returns an Integer data type representing the subtype of the variable specified invarname

Several VB constants are used to define the data types returned by the VarType function, including: vbEmpty, vbNull, vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbDate, vbString, vbObject, vbError, vbBoolean, vbVariant, vbDataObject, vbDecimal, vbByte, and vbArray.

Go Back to Top

arrowl2Return to the Visual Basic 6 Commands & Functions Page 

Comments

 

Latest Version! NetObjects Fusion 10 

 

Copyright 1998 Rich Hamper 

All Rights Reserved

 

Last Updated:

Sunday, January 20, 2008