Solved

Certain files in listbox

Posted on 2003-11-26
6
176 Views
Last Modified: 2010-05-03
Hi,
Im working on a file sharing program.
I want it so when the person views the host's files, all they see are .txt and .log

here is the part listing it


Private Sub fillDir(Incoming As String)

Dim i As Integer
Dim strCut As String

    cutString strCut, Incoming
    i = Val(strCut)
   
    If i > 1 Then
        For i = 1 To i - 1
             cutString strCut, Incoming
             lstFiles.AddItem strCut
        Next i
    End If
   
    lstFiles.AddItem Incoming
    lstFiles.ListIndex = 0
End Sub

0
Comment
Question by:raptorpb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 9

Expert Comment

by:p_sie
ID: 9830261
For i = 1 To i - 1
         cutString strCut, Incoming
         IF Right(StrCut,4) <> ".txt" AND Right(StrCut,4) <> ".log" Then
                      lstFiles.AddItem strCut
         End If
Next i
0
 

Author Comment

by:raptorpb1
ID: 9830310
Doesn't work. I still see all the files
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 450 total points
ID: 9830373
For i = 1 To i - 1
        cutString strCut, Incoming
        IF Right(StrCut,4) = ".txt" OR Right(StrCut,4) = ".log" Then
                     lstFiles.AddItem strCut
        End If
Next i
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 9

Expert Comment

by:p_sie
ID: 9830426
Sorry, i read it wrong
did think you didn't want .txt and .log.
0
 

Author Comment

by:raptorpb1
ID: 9830590
Thank You
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9830638
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question