Funkcja tworzenia obiektu VBScript
❮ Pełne odniesienie do VBScriptFunkcja CreateObject tworzy obiekt określonego typu.
Składnia
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 |
Przykład
Przykład
Tworzenie obiektu wyrażenia regularnego:
<%
txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
response.write(objReg.Replace(txt,"##"))
%>
Wynikiem powyższego kodu będzie:
Th##s is a beautiful day
❮ Pełne odniesienie do VBScript