add vbscript demo

This commit is contained in:
nightwing 2012-12-28 02:07:29 +04:00
commit b6094d9472
3 changed files with 25 additions and 0 deletions

View file

@ -119,6 +119,7 @@ var docs = {
"docs/tex.tex": "Tex",
"docs/textile.textile": {name: "Textile", wrapped: true},
"docs/typescript.ts": "Typescript",
"docs/vbscript.vbs": "VBScript",
"docs/xml.xml": "XML",
"docs/xquery.xq": "XQuery",
"docs/yaml.yaml": "YAML",

View file

@ -0,0 +1,23 @@
myfilename = "C:\Wikipedia - VBScript - Example - Hello World.txt"
MakeHelloWorldFile myfilename
Sub MakeHelloWorldFile (FileName)
'Create a new file in C: drive or overwrite existing file
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(FileName) Then
Answer = MsgBox ("File " & FileName & " exists ... OK to overwrite?", vbOKCancel)
'If button selected is not OK, then quit now
'vbOK is a language constant
If Answer <> vbOK Then Exit Sub
Else
'Confirm OK to create
Answer = MsgBox ("File " & FileName & " ... OK to create?", vbOKCancel)
If Answer <> vbOK Then Exit Sub
End If
'Create new file (or replace an existing file)
Set FileObject = FSO.CreateTextFile (FileName)
FileObject.WriteLine "Time ... " & Now()
FileObject.WriteLine "Hello World"
FileObject.Close()
MsgBox "File " & FileName & " ... updated."
End Sub

View file

@ -91,6 +91,7 @@ var modesByName = {
text: ["Text" , "txt"],
textile: ["Textile" , "textile"],
typescript: ["Typescript" , "typescript|ts|str"],
vbscript: ["VBScript" , "vbs"],
xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
xquery: ["XQuery" , "xq"],
yaml: ["YAML" , "yaml"]