View Single Post
Old 03-22-2005, 10:02 AM   #5 (permalink)
mack
 
Super Techie

Join Date: Aug 2003

Posts: 348

mack is on a distinguished road

Default

Because it's wrong.

Wrong:

Code:
if i = 0 then 
 GETTRUEFALSE = FALSE
else
if i < 2 then GETTRUEFALSE = TRUE
else
if i = 3 then GETTRUEFALSE = FALSE
end if
Right (faster)

Code:
Select Case i
  Case 0: GetTrueFalse = False
  Case < 2: GetTrueFalse = True
  Case 3:  GetTrueFalse = False
End Select
Should work if you have i as in integer (Dim as integer) if you're using VB6 but if you're not youll need to convert it to an integer by doing:

int(i)

So change:
Code:
Select Case int(i)
Hope it helps
__________________

Windows 7 Professional
AMD x2 4400+
ASUS A8N-32 SE Deluxe
FSP Group 500 watt PSU
4GB PC3200 Dual-Channel
EVGA 8800 GT
150GB Raptor 10K HDD
250GB Western Digital HDD
Jobs
Electrician
C# Programmer+Web Programmer
Gamer
mack is offline