mick_robo
04-03-2003, 09:19 PM
this is my function to convert a decimal no. to a binary no.
is there a way that i can use a do, loop command rather than the while, wend command.
Function tobinary(x As Integer) As String
Dim s As String
If x = 0 Then
s = "0"
Else
s = ""
While x <> 0
s = (x Mod 2) & s
x = Int(x / 2)
Wend
End If
tobinary = s
End Function
thanks!
is there a way that i can use a do, loop command rather than the while, wend command.
Function tobinary(x As Integer) As String
Dim s As String
If x = 0 Then
s = "0"
Else
s = ""
While x <> 0
s = (x Mod 2) & s
x = Int(x / 2)
Wend
End If
tobinary = s
End Function
thanks!