![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
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 Subbtw 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
__________________
"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 |
|
|
|
|
|
#2 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#3 | |
|
Expert Programmer
|
Quote:
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 |
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 482
Rep Power: 3
![]() |
Are you talking to yourself? Very nice monolog!
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|