2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JScript 事始め その2

Last updated at Posted at 2014-10-17

暇だったので、簡単プログラム。

JSE

speed.jse
var distance = 20; //Kmの距離を
var min = 30; //分で到着するには?

var hour = min/60; //時間
var speed = distance / hour;

WScript.echo("速度:" + speed  + "km/h");

speed.PNG

WSF

今度は、入力を受けるためにプロンプトを表示させたくなった。
しかし、jseでは入力プロンプトが表示できないようだ。

そこで、下記のようにwsfファイルを作成する。

prompt.wsf
<job id="hoge">
	<script language="VBScript">
		Function VBInputBox(msg)
			VBInputBox = InputBox(msg)
		End Function
	</script>
	<script language="JScript">
		var name = VBInputBox("あなたの名前は?");
		WScript.Echo("こんにちは " + name + "さん!!");
	</script>
</job>

prompt.PNG

prompt2.PNG

詳細はわからないが、とりあえず動作した。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?