vbscript – With…End With

**STATEMENT:** `With…End With`

**Description**
Réduit la répétition sur un même objet.

**Syntax**
`With…End With`

**Paramètres**
– *(aucun)*

**Notes**
– Astuce : active `Option Explicit` dans tes scripts pour éviter les variables mal orthographiées.

**Exemples**
« `vb
Dim re
Set re = CreateObject(« VBScript.RegExp »)
With re
.Pattern = « ^d+$ »
.Global = False
End With
WScript.Echo re.Test(« 123 »)
« `

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *