Boolean Declaration
as an alternative to Chip's answer, you might find a CLASS object useful
the following demonstrates...
' STANDARD MODULE
Option Explicit
Sub Main()
Dim MyHeight As cHEIGHT
Set MyHeight = New cHEIGHT
MyHeight.TALL False
MsgBox MyHeight.HEIGHT
MyHeight.TALL True
MsgBox MyHeight.HEIGHT
End Sub
' CLASS MODULE: cHEIGHT
Option Explicit
Private m_height As Boolean
Public Function HEIGHT() As String
If m_height Then
HEIGHT = "TALL"
Else
HEIGHT = "SHORT"
End If
End Function
Sub TALL(newHeight As Boolean)
m_height = newHeight
End Sub
regards
Patrick
(once an MVP, always er ...)
"Shatin" wrote:
Hi All,
Say I have a variable called Height and I want to declare it as a Boolean
variable with possible values "Tall" or "Short" rather than True or False.
How should I declare it?
TIA
|