update
Former-commit-id: bdede6ed1b6f578f2ef046c338caf02d0b29d453 [formerly 7187de361b53e9c8ec121df379b762f2db736ea2] Former-commit-id: 447d58460fbbfd05ffe08428a1288e392637561d
This commit is contained in:
23
_embed/public/ace/demo/kitchen-sink/docs/vbscript.vbs
Normal file
23
_embed/public/ace/demo/kitchen-sink/docs/vbscript.vbs
Normal 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
|
||||
Reference in New Issue
Block a user