' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Function ToBin(v As Integer) As String
    Dim tmp As Integer
    Dim res As String
    tmp = v
    res = ""
    While tmp > 0
        res = CStr(tmp Mod 2) & res
        tmp = tmp \ 2
    Wend
    ToBin = res
End Function

Function TestToBin()
   MsgBox ToBin(10)
End Function
