VBScript -CreateObject- Funktion

❮ Vollständige VBScript-Referenz

Die CreateObject-Funktion erstellt ein Objekt eines angegebenen Typs.

Syntax

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

Beispiel

Beispiel

Erstellen eines regulären Ausdrucksobjekts:

<%

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

%>

Die Ausgabe des obigen Codes lautet:

Th##s is a beautiful day

❮ Vollständige VBScript-Referenz