データ型をユーザー定義する
Type BaseDate
FtName As String
FyNmae As String
Sex As Boolean
BdYear As Integer
BdMonth As Integer
BdDay As Integer
End Type
Sub 基本情報()
Dim mydate As BaseDate
With mydate
.FtName = "のび太"
.FyNmae = "野日"
.Sex = True
.BdYear = 1970
.BdMonth = 7
.BdDay = 7
If .Sex = True Then
性別 = "男"
Else
性別 = "女"
End If
MsgBox .FyNmae & .FtName & "(" & 性別 & ")の誕生日は" & _
.BdYear & "年" & .BdMonth & "月" & .BdDay & "日です。"
End With
End Sub
FtName As String
FyNmae As String
Sex As Boolean
BdYear As Integer
BdMonth As Integer
BdDay As Integer
End Type
Sub 基本情報()
Dim mydate As BaseDate
With mydate
.FtName = "のび太"
.FyNmae = "野日"
.Sex = True
.BdYear = 1970
.BdMonth = 7
.BdDay = 7
If .Sex = True Then
性別 = "男"
Else
性別 = "女"
End If
MsgBox .FyNmae & .FtName & "(" & 性別 & ")の誕生日は" & _
.BdYear & "年" & .BdMonth & "月" & .BdDay & "日です。"
End With
End Sub
by yuna-tip
| 2002-10-06 16:31
| 変数