Solved

Certain files in listbox

Posted on 2003-11-26
6
170 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
  • 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now