Função CreateObject do VBScript
❮ Referência completa do VBScriptA função CreateObject cria um objeto de um tipo especificado.
Sintaxe
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 |
Exemplo
Exemplo
Criando um objeto de expressão regular:
<%
txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
response.write(objReg.Replace(txt,"##"))
%>
A saída do código acima será:
Th##s is a beautiful day
❮ Referência completa do VBScript