TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: `asd987`
date: 2005-02-10 10:51:00
subject: question about simple array

Hello,

I'm looking for the best way to give an user the possiblity to search in
multiple directories for certain photos. I was thinking about using an array
to do so. This is the Command1_Click - code below.

## ---

Private Sub Command1_Click()
' create an array containing the content of
' two directories

Dim MyVar(), MaxItems As Integer

File1.Path = "c:\my documents\photo-archive1"
File2.Path = "c:\my documents\photo-archive2"
File1.Pattern = "*.jpg"
File2.Pattern = "*.jpg"

MaxItems1 = File1.ListCount
MaxItems2 = File2.ListCount
Let MaxItems = MaxItems1 + MaxItems2

For i = 0 To MaxItems1 - 1
MyVar(i) =  File1.List(i)
Next i

For i = 0 To MaxItems2 - 1
MyVar(i) =  File2.List(i)
Next i

End Sub

## ---

After this the desired information must be presented. I want to do this in a
ListBox. The user can type in a Text-field (parts of) the name of the photos
he is looking for. The filenames are displayed and by clicking them the
corresponding photo must be shown.

## ---

Private Sub Text1_Change()
' display that selection of the array that
' corresponds with "*" & Text1.Text & "*.jpg"
' use a ListBox (List1.AddItem)


End Sub

## ---

Now I don't know how to write the Text1_Change-code for the selection part.
Perhaps there is a much more easier way for this?

Thanks,

Sjoerd





--- UseNet To RIME Gateway {at} 2/10/05 10:45:59 AM ---
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270 5030/786
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.