Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Roll your own Boolean TriState value

Hi all :WAVE:
I would like to write a logic statement
That works like the Boolean value

ok I can

Option Explicit
Dim big As Boolean
Private Sub Form_Load()
big = True
Text1.Text = big
End Sub


'The Text of Text1 shows "True"
'++++++++++++++++++++++++++++

Enum size
little = 0
big = 1
End Enum

Dim thesize As size

Private Sub Form_Load()
thesize = big
Text1.Text = thesize
End Sub

'The Text of Text1 shows "1"

'I would like Text1 to show "big"

How do you do this, I dont have a clue how to go about it.
[672 byte] By [Log_in] at [2007-11-11 7:50:49]
# 1 Re: Roll your own Boolean TriState value
You can't convert the enum to a string. You would need a series of IF/Then statements, or a select case.

Like this:

select case thesize
case big
tText1.Text = "big"

case little
tText1.Text = "little"
end select
edburdo at 2007-11-11 17:26:25 >
# 2 Re: Roll your own Boolean TriState value
Hi all
I would like to write a VarType Library
That works like the Boolean value

ok I can do this with vbBoolean


Option Explicit
Dim big As Boolean
Private Sub Form_Load()
big = True
Text1.Text = big
End Sub

The Text of Text1 shows "True"

A good example of what I'm trying to do

Const vbBoolean = 11
Member of VBA.VbVarType
Return value constant for VarType

'++++++++++++++++++++++++++++
>>>>The VarType Library<<<<

Member of Log_in.NewVarType

Enum NVT
size = 666
Boolean = 11
End Enum
Enum size
little = 0
big = 1
End Enum

Public Function NVT(VarType&)$
if VarType = 666 and size = 1 then NVT = "Big"
End Function


Dim thesize As size

Private Sub Form_Load()
thesize = big
Text1.Text = thesize
End Sub

I would like Text1 to show "big"

How do you do this

If any want can gave me a pointer to sneeped,
preferably sneeped of the vbBoolean funtion.

I dont have a clue how to go about it.
Log_in at 2007-11-11 17:27:25 >