VBScript CreateObject- functie

❮Volledige VBScript-referentie

De functie CreateObject maakt een object van een opgegeven type.

Syntaxis

CreateObject(servername.typename[,location])
Parameter Description
servername Required. The name of the application that provides the object
typename Required. The type/class of the object
location Optional. Where to create the object

Voorbeeld

Voorbeeld

Een object voor reguliere expressies maken:

<%

txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
response.write(objReg.Replace(txt,"##"))

%>

De uitvoer van de bovenstaande code zal zijn:

Th##s is a beautiful day

❮Volledige VBScript-referentie