Reputation: 21
I have a program that uses some user input to automatically create files I need for an upload process. The files are a .bas (qbasic program) and a .lot (a voxco automaton file). The files are created perfectly, the syntax is flawless. When I try to run the batch files that start the basic program and the lot file stuff, it breaks down. The programs (voxco and basic) don't seem to know how to read the files. I'm at a loss. I don't think it is the encoding. I think my VB.net program is creating a text file with a ".lot" and ".bas" extension, and the two other programs don't know how to deal with that. But I have no idea how to create the proper files other than naming them .lot and .bas. Anyone have any experience with this?
Here's some of the code that creates the .LOT file:
'Create a copy of the old lot file
My.Computer.FileSystem.CopyFile(LotFilePath & OldStudy & ".LOT", LotFilePath & "BackEnd\" & OldStudy & ".LOT")
System.IO.File.Create(LotFilePath & "BackEnd\" & StudyID & ".LOT").Dispose()
Dim LotText As String
LotText = Text to put into LOT file
Dim QuLines As String = Nothing
Dim Reader As New StreamReader(LotFilePath & OldStudy & ".LOT")
Dim SLine As String = Nothing
While Not Reader.EndOfStream
SLine = Reader.ReadLine()
If SLine.StartsWith("*QU") Then
QuLines = QuLines & SLine & vbCrLf
End If
End While
LotText = LotText & QuLines
Dim TempPath As String
TempPath = LotFilePath & "BackEnd\" & StudyID & ".LOT"
My.Computer.FileSystem.WriteAllText(TempPath, LotText, 0)
And here's the code that creates the BAS file:
Dim BasText As String = Nothing
BasText = Text to input into BAS file
TempPath = BasFilePath & StudyID & ".BAS"
My.Computer.FileSystem.WriteAllText(TempPath, BasText, 0)
Upvotes: 2
Views: 1044
Reputation: 15813
Here are some things to try:
Upvotes: 2