Click here to Skip to main content
15,888,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: add an ID from an from an combobox in buttun click event Pin
Christian Graus26-Jan-09 0:23
protectorChristian Graus26-Jan-09 0:23 
Question[Message Deleted] Pin
IvanIT25-Jan-09 10:45
IvanIT25-Jan-09 10:45 
AnswerRe: Insert new Line in a Text File Pin
Wendelius25-Jan-09 10:59
mentorWendelius25-Jan-09 10:59 
GeneralRe: Insert new Line in a Text File Pin
IvanIT25-Jan-09 11:06
IvanIT25-Jan-09 11:06 
GeneralRe: Insert new Line in a Text File Pin
Wendelius25-Jan-09 11:20
mentorWendelius25-Jan-09 11:20 
GeneralRe: Insert new Line in a Text File Pin
Jon_Boy26-Jan-09 1:54
Jon_Boy26-Jan-09 1:54 
GeneralRe: Insert new Line in a Text File Pin
IvanIT26-Jan-09 7:40
IvanIT26-Jan-09 7:40 
GeneralRe: Insert new Line in a Text File Pin
Guffa26-Jan-09 10:52
Guffa26-Jan-09 10:52 
Can you explain how you were thinking when writing this? It's not even close to working...

IvanIT wrote:
CurrentLine = sReader.ReadLine
If CurrentLine.StartsWith("CBS*TODAY*ZZ*") = True Then
sReader.ReadToEnd()
End If


Here you only read the first line of the file and throw away the rest. Then you just forget about the line that you read, because you never use that for anything.

The comment earlier in the code suggests that you attempt to find a line in the file, but you don't have any loop so the only line that you ever look at is the first one.

IvanIT wrote:
oError = New System.IO.StreamWriter("c:\Shadow\moviez_21.txt", True)


Here you open the file for appending, that means that you contine to write at the end of the file.

IvanIT wrote:
'text to be inserted always after CBS*TODAY*ZZ*
oError.Write("REF*LU*") ' + file number


The comment doesn't at all correspond to what you are actually doing. You are writing that string at the end of the file, regardless if you found the string that you were looking for or not.

All the code that you have written could be replaced with just this:

Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click
   MessageBox.Show("you are about to translate file")
   System.IO.File.AppendAllText("c:\Shadow\moviez_21.txt", "REF*LU*")
End Sub


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Insert new Line in a Text File Pin
IvanIT26-Jan-09 11:37
IvanIT26-Jan-09 11:37 
GeneralRe: Insert new Line in a Text File Pin
Guffa26-Jan-09 13:38
Guffa26-Jan-09 13:38 
AnswerRe: Insert new Line in a Text File Pin
Guffa26-Jan-09 6:16
Guffa26-Jan-09 6:16 
QuestionHow to load & Unload form in vb.net ? Pin
zanzmera25-Jan-09 9:27
zanzmera25-Jan-09 9:27 
AnswerRe: How to load & Unload form in vb.net ? Pin
ivo7525-Jan-09 9:40
ivo7525-Jan-09 9:40 
AnswerRe: How to load & Unload form in vb.net ? Pin
Dave Kreskowiak25-Jan-09 10:07
mveDave Kreskowiak25-Jan-09 10:07 
AnswerRe: How to load & Unload form in vb.net ? Pin
Ashutosh Phoujdar26-Jan-09 19:15
Ashutosh Phoujdar26-Jan-09 19:15 
QuestionProblem to insert data from DateTimePicker to Access database Pin
ivo7525-Jan-09 8:42
ivo7525-Jan-09 8:42 
AnswerRe: Problem to insert data from DateTimePicker to Access database Pin
Wendelius25-Jan-09 9:18
mentorWendelius25-Jan-09 9:18 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
ivo7525-Jan-09 9:36
ivo7525-Jan-09 9:36 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
Wendelius25-Jan-09 9:52
mentorWendelius25-Jan-09 9:52 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
ivo7525-Jan-09 9:55
ivo7525-Jan-09 9:55 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
Wendelius25-Jan-09 10:05
mentorWendelius25-Jan-09 10:05 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
ivo7525-Jan-09 21:19
ivo7525-Jan-09 21:19 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
ChandraRam25-Jan-09 22:23
ChandraRam25-Jan-09 22:23 
GeneralRe: Problem to insert data from DateTimePicker to Access database Pin
Wendelius26-Jan-09 5:17
mentorWendelius26-Jan-09 5:17 
AnswerRe: Problem to insert data from DateTimePicker to Access database Pin
Mr Oizo26-Jan-09 1:13
Mr Oizo26-Jan-09 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.