[AccessD] OT: Friday Puzzles

Drew Wutka DWUTKA at Marlow.com
Fri Apr 23 10:59:55 CDT 2010


Victim is a class, here's the code:

Option Explicit
Public OriginalPosition As Long
Public Shot As Boolean

Private Sub Class_Initialize()
Shot = False
End Sub

;)

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mike Mattys
Sent: Friday, April 23, 2010 10:48 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] OT: Friday Puzzles



Hi Drew,

It appears that you have a reference set that I don't have
What library in Victim in?

Michael R Mattys
Business Process Developers
www.mattysconsulting.com

----- Original Message ----- 
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Friday, April 23, 2010 11:38 AM
Subject: Re: [AccessD] OT: Friday Puzzles


> Hi Drew
> 
> What is this? You always bark about how busy you are. 
> Can't wait for Friday beer!?
> 
> /gustav
> 
> 
>>>> DWUTKA at marlow.com 23-04-2010 17:26:38 >>>
> LOL, nah, I'll stick with 'code boy'
> 
> Private Sub Command1_Click()
> Dim Victims As Collection
> Dim vt As Victim
> Dim i As Long
> Dim strTemp As String
> Dim strPaste As String
> Set Victims = New Collection
> For i = 1 To 1000
>    Set vt = New Victim
>    vt.OriginalPosition = i
>    Victims.Add vt, "ID:" & i
>    Set vt = Nothing
> Next i
> Do Until Victims.Count <= 1
>    For i = 1 To Victims.Count Step 2
>        Set vt = Victims(i)
>        vt.Shot = True
>        Set vt = Nothing
>    Next i
>    'Remove shot victims
>    strTemp = ""
>    For Each vt In Victims
>        If vt.Shot Then
>            Victims.Remove "ID:" & vt.OriginalPosition
>        Else
>            strTemp = strTemp & vt.OriginalPosition & ","
>        End If
>    Next
>    Me.List1.AddItem Left(strTemp, Len(strTemp) - 1)
>    strPaste = strPaste & Left(strTemp, Len(strTemp) - 1) & vbCrLf
> Loop
> Clipboard.Clear
> Clipboard.SetText strPaste
> End Sub
> 
> Drew
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list