1
0

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 1 year has passed since last update.

vbsの作法 その66

Last updated at Posted at 2023-05-24

概要

vbsの作法、調べてみた。
練習問題、やってみた。

練習問題

湯婆婆を、実装せよ。

写真

image.png

サンプルコード

str = "契約書" & vbCrLf & "甲は油屋当主として、乙を油屋に雇用することを" & vbCrLf & "契約し、労働に伴う対価の支払いを右の通り、約定する。" & vbCrLf 
str = str & "なお、一日の労働の対価は金百円とする。" & vbCrLf & "甲 油屋当主 湯婆婆" & vbCrLf & "乙" & vbCrLf & "契約書だよ。そこに名前を書きな。"
Title = "湯婆婆" 
Dim name
name = InputBox(str , Title, "腹美恵子")
If name = "" Then
	WScript.Quit
End If
If Len(name) = 0 Then
    Wscript.Arguments(-1)
End If
str = "フン。" & name & "というのかい。贅沢な名だねぇ。" & vbCrLf
Dim newName
Randomize
newName = Mid(name, Int(Len(name) * Rnd + 1), 1)
str = str & "今からお前の名前は" & newName & "だ。いいかい、" & newName & "だよ。分かったら返事をするんだ、" & newName & "!!"
MsgBox (str)

以上。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?