Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 27th, 2005, 6:41 PM   #1
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
question about filename in common dialog

for most likely a good reason it will not accept my FileName$ string when i want to open it? Wonder why?

Private Sub fileload_cmd_Click()
    Dim tmpData As String

    filepath_dia.ShowOpen     'open common dialog
    
    filepath_txt.Text = filepath_dia.FileName
    
    Open Trim$(FilePath$) For Input As #1
        
        Do
            Line Input #1, tmpData$
            
            If (Left$(tmpData, 6) = "\" \ ",\" \ ",") Then
                'stats_lbl(1).Caption = "Empty Record"
                LineNum = LineNum + 1
                msgbox_txt.Text = msgbox_txt.Text + "Line(" + LineNum + ")=empty record"
            Else
                LineNum = LineNum + 1
            End If
        Loop Until EOF(1)
        
    Close #1
   
End Sub

btw haven't used vb in like 3-4 years.. also how can i alter the common dialog fiter settings.. for lets say *.txt

commondialog1.filters=(*.txt)     //doesn't work
[/code]
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 27th, 2005, 7:38 PM   #2
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
ok i fixed my problem (not the filter problem)

my new question is... line replacing! say when i come across an empty record (a line with specific characters) i want to replace the entire line with something else? any input?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 27th, 2005, 8:52 PM   #3
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
Quote:
Originally Posted by Kilo
ok i fixed my problem (not the filter problem)

my new question is... line replacing! say when i come across an empty record (a line with specific characters) i want to replace the entire line with something else? any input?
ADDITION EDIT:
i do not understand why i cannot store the len of a string into a integer var

    fNameInt1 = Len(Trim$(Right$(FilePath$, "\"))) 'PROBLEM
    fName1 = Mid$(FilePath$, fNameInt1, Len(FilePath$))
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 28th, 2005, 12:57 AM   #4
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
disregard this.. i give up! im writing this prog in a real language c++
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 28th, 2005, 3:42 AM   #5
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Are you talking to yourself? Very nice monolog!
ivan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:47 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC