Category Archives: Visual Basic 6

Boolean Gray Code 4,6

?join(GraySeq(4),vbnewline) 00000001001100100110011101010100110011011111111010101011 1001 1000 ?join(GraySeq(6),vbnewline) 000000000001000011000010000110000111000101000100001100001101001111001110001010001011001001001000011000011001011011011010011110011111011101011100010100010101010111010110010010010011010001010000110000110001110011110010110110110111110101110100111100111101111111111110111010111011111001111000101000101001101011101010101110101111101101101100100100100101100111100110100010100011100001100000

Posted in Visual Basic 6 | Leave a comment

Visual Basic “fast & naive” iterative permutation

Option Explicit   Private Sub OnInstance(N() As Long)   Dim ret As String     Dim Ix As Long   For Ix = LBound(N) + 1 To UBound(N)     ret = ret & " " & N(Ix)   Next ‘  … Continue reading

Posted in Visual Basic 6 | Leave a comment

Average

  Dim a As Variant  a = Array(12, 1, 21, 2, 12, 3, 123, 124, 3456, 47, 5, 24, 323, 534, 45, 345, 13)   Dim P  As Double  Dim k  As Long: k = 0  Dim bo As Long: bo … Continue reading

Posted in Visual Basic 6 | Leave a comment

VB6 Static array bug?

Place this code into a module   Public Property Get Values() As Variant()          Static Called As Boolean      Static ret() As Variant       If Not Called Then        ret = Array("a", "b", "c")        Called = True      End If       Values = … Continue reading

Posted in Visual Basic 6 | Leave a comment

syslistview, ListView spy

Run the code below if you want to steal data from a syslistview control   Dim Ix    As Long, Field As Variant  Dim Spy As New ListViewSpy: Call Spy.Init(ListViewHwnd)   ‘— ListViewHwnd : The handle of the target listview … Continue reading

Posted in Visual Basic 6 | Leave a comment