' 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) 
﻿Module Program
    Sub Main()
        Dim b() As Byte = { 1, 2, 3, 4, 5, 6, 7 }
        Dim res As Long
        ' let us assume little endian
        res = CType(b(0),Long) _
              Or (CType(b(1), long) << 8) _
              Or (CType(b(2), Long) << 16) _
              Or (CType(b(3),Long) << 24) _
              Or (CType(b(4),Long) << 32) _
              Or (CType(b(5),Long) << 40) _
              Or (CType(b(6),long) << 48)
        Console.WriteLine(res.ToString("X16"))
    End Sub
End Module
