2012-02-01から1ヶ月間の記事一覧

JScript ユーザーズ ガイド、型の自動変換

WScript.Echo(1 + "2"); WScript.Echo(1 + "2" + 1); WScript.Echo(true + "1"); WScript.Echo(false + "1"); WScript.Echo(true + 1); WScript.Echo(false + 1);

JScript ユーザーズ ガイド、null, undefined

var x; WScript.Echo(1 == 1); // -1 WScript.Echo(x + 2 == x); // 0 WScript.Echo(x * 2 == x); // 0 WScript.Echo(x == null); // -1 WScript.Echo(0 == null); // 0

JScript ユーザーズ ガイド、未代入は undefined

var x; WScript.Echo(x + 1); WScript.Echo(x * 1);

JScript ユーザーズ ガイド、変数の大文字・小文字は区別あり

foo = "foo"; FOO = "FOO"; WScript.Echo(foo); WScript.Echo(FOO);

JScript ユーザーズ ガイド、変数の宣言

var x; var x; var x, y, z; var x = 0, y = 1, z;

JScript ユーザーズ ガイド、式・演算子

WScript.Echo(1+2*3); WScript.Echo("a" + "b"); WScript.Echo(1 + "1"); 数値は文字に変換されるんだっけ???

JScript ユーザーズ ガイド、リテラル

WScript.Echo(1.2); WScript.Echo("Hello!"); WScript.Echo(false); WScript.Echo(null); WScript.Echo({x:1, y:2}); WScript.Echo([1,2,3]);

JScript ユーザーズ ガイド、関数とスコープ

function foo() { x = "FOO"; WScript.Echo(x); } x = "foo"; foo(); WScript.Echo(x); では二度とも「FOO」 function foo() { var x = "FOO"; WScript.Echo(x); } x = "foo"; foo(); WScript.Echo(x); と var をつけてあげると、最初は「FOO」。二度目は「f…

JScript ユーザーズ ガイド、中かっこでブロック

x = "foo"; { x = "FOO"; WScript.Echo(x); } WScript.Echo(x); 別にスコープができるわけでもなさそう

JScript ユーザーズ ガイド、変数宣言・変数への代入

x = "foo"; var y = Date(); var z; z = "bar"; WScript.Echo(x); WScript.Echo(y); WScript.Echo(z);

はじめの一歩

http://msdn.microsoft.com/ja-jp/library/cc427807.aspx を見ていく WScript.Echo("Hello!");

Script ランタイム、FileSystemObject、TextStream オブジェクト、Line プロパティ

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Column プロパティ

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…

Script ランタイム、FileSystemObject、TextStream オブジェクト、AtEndOfStream プロパティ

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading) Do…

Script ランタイム、FileSystemObject、TextStream オブジェクト、AtEndOfLine プロパティ

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…

Script ランタイム、FileSystemObject、TextStream オブジェクト、WriteLine メソッド

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…

Script ランタイム、FileSystemObject、TextStream オブジェクト、WriteBlankLines メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteBlankLines(2) f.Write "Hello world!" Set f = fso.OpenTextFile("…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Write メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" & vbCrLf f.Write "HELLO WORLD!" Set f = fso.Ope…

Script ランタイム、FileSystemObject、TextStream オブジェクト、SkipLine メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.Open…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Skip メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、ReadLine メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.Open…

Script ランタイム、FileSystemObject、TextStream オブジェクト、ReadAll メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Read メソッド

まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Close メソッド

Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile("foo.txt") f.Close f.Close Close したものを再度 Close してもエラー発生しない???

Script ランタイム、FileSystemObject、Drives プロパティ

Set fso = CreateObject("Scripting.FileSystemObject") For Each d in fso.Drives WScript.Echo d Next

Script ランタイム、FileSystemObject オブジェクト、OpenTextFile メソッド

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine("Hello!") f.Close CreateTextFile とはどう違う?どう使い分ける?

Script ランタイム、FileSystemObject オブジェクト、MoveFolder メソッド

Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder("foo") fso.MoveFolder "foo", "c:\"

Script ランタイム、FileSystemObject オブジェクト、MoveFile メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.MoveFile("foo", "bar") 'fso.MoveFile "bar", "foo" 「fso.MoveFile("foo", "bar")」はダメでも、「WScript.Echo fso.MoveFile("foo", "bar")」は良いのか〜

Script ランタイム、FileSystemObject オブジェクト、GetTempName メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName 存在するファイル名を返しちゃったりしないのかな?