?type something like Boolean
:afrog: What Im trying to achieve is to make my own
?type something like Boolean
Dim isOn As Boolean
Enum is wrong I think but it will gave you some idea of what
VB Code:
Im trying to achieve
Enum State
isOn = -1
isOff = 0
End Enum
Dim MyState As State
Sub Swichstate
If MyState= isOn Then MyState = isOff Else MyState = isOn
End Sub
Enum Size
Small = -1
Medium= 0
Big = 1
End Enum
Dim PlateSize As Size
Sub Swicht(PlateOverFlows As Boolean)
If PlateOverFlows = True Then
Select Case PlateSize
Case Small
PlateSize = Medium
Case Medium
PlateSize = Big
Case Big
Get_AtherPlate
End Select
End Sub
Re: ?type something like Boolean
Code:
Dim isOn as Boolean
isOn = True
isOn = Not True 'Not True is faster than False
Re: ?type something like Boolean
Now Im realize what Im trying to do
make my own "vartype"
Re: ?type something like Boolean
you cant do that with VB you have to code ASM
Re: ?type something like Boolean
Quote:
Originally Posted by _visual_basic_
you cant do that with VB you have to code ASM
Not in the way he wants it but you can always do something like the following (not sure why but anyway):
VB Code:
Option Explicit
Private Type tStatus
blnStatus As Boolean
End Type
Dim MyStatus As tStatus
Private Sub Command1_Click()
MyStatus.blnStatus = Not MyStatus.blnStatus
Check1.Value = Abs(CInt(MyStatus.blnStatus))
End Sub
Re: ?type something like Boolean
Quote:
...Enum is wrong I think...
Why?