C++/VB - File writing

Asked By Desmond
22-Dec-09 08:35 AM
I am having reading and writing to a text file

Input line
(122, '1255130744', '2009-10-10', '00:25:44', '67.195.112.172',
'PartnerUs', 'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0;
http://help.yahoo.com/help/us/ysearch/slurp)', 'R'),

Output line
'PartnerUs', 'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0;
http://help.yahoo.com/help/us/ysearch/slurp)', 'R'),

In debug mode this works. But looking at the result file I have an
extra quote at the beginning of the lin.

------ Code -----
Private Sub Form_Load()
Dim x As String
Dim y As String
Dim ReadMe As String
Dim SplitArray() As String
Dim TextLine As String
Dim NewLine As String

Open "F:\VB Apps\MalawiLog2.txt" For Input As 3
Line Input #3, ReadMe
Open "F:\VB Apps\MalawiLog2a.txt" For Output As 4
Do While Not EOF(3)
Line Input #3, TextLine
SplitArray = Split(TextLine, ",")
NewLine = "(''," & SplitArray(1) & "," & SplitArray(2) & "," &
SplitArray(3) & "," & SplitArray(4) & "," & SplitArray(5) & "," +
SplitArray(6) & "," & SplitArray(7) & "," & vbCrLf
Write #4, NewLine;
Loop
Close #3
Close #4
End Sub

Any sugestions as to why the extea quote?
VB
(1)
VbCrLf
(1)
SplitArray
(1)
TextLine
(1)
NewLine
(1)
ReadMe
(1)
Catcher
(1)
ICode
(1)
  Dee Earley replied to Desmond
22-Dec-09 08:15 AM
Try Print # instead, Write # adds stuff so it can be read back later.
I think You will have double quotes on all subsequent lines as well.

You can also remove the & vbcrlf from the end of newline along with the
; from the Write line as the cancel each other out.

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems
  mscir replied to Dee Earley
23-Dec-09 05:53 PM
You might also consider using freefile instead of manually assigning
file numbers:

http://en.wikibooks.org/wiki/Visual_Basic/Files
http://www.xtremevbtalk.com/showthread.php?t=21856

Mike
Create New Account
help
Nothing C++ / VB Sub Include(ByVal includefile) Dim fso, s, f Set fso = CreateObject("Scripting.FileSystemObject") If fso not also 'Set fso = Nothing'? VBScript Discussions Routine (1) Bytes (1) Bit (1) VBA (1) VB (1) CreateObject (1) Application (1) FileExists (1) JJ presented the following explanation : Well, if this should get explicitly destroyed. 2. If I implicitly create an object, I leave it to VB to implicitly destroy when it runs out of scope. (ie: Dim oColl As New Collection use explecit. Note that anything left to be done implicitly ALWAYS requires extra processing by VB / A / Script, adding to runtime overhead. There is more disadvantages to implicitly creating objects and http: / / www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion That's it??? After serious thinking JJ wrote : Where is the rest of http: / / www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion I am with Garry, but it is "controversial". People have different opinions. I http: / / www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion Sorry, I believe you are misreading his "famous" rant. Explanations #3 and #4 http: / / www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion Oops! Typo. . . I used to thinK along the same lines as Eric once
Definitely a Newbie- -Need an example C++ / VB I am told VBS comes with MS OSes, and that if I had an example can carry about 240, 000 pounds. . . John There are exactly four ways to launch a VB Script: a) Right-click the shortcut. This is common for all shortcuts, not just VB Script. b) Typing the script name at the command prompt (which is the same as between c) and d) which you will come to appreciate as you dig deeper into VB Scripting. What is strange about downloading the tutor / intro file? Which file is it, in way is Visual Basic. By almost luck, when a friend moved, he gave me two VB 5 books, and the compiler (Interpreter?) Why VB. I am using a scientific app that allows one to extend facilities of the app other program the app works with. No need to even run the app. Just use VB. Still curious about VBS. My guess is that it is nowhere as powerful as using VB, but is not really used for of with html. - - Wayne Watson (Watson Adventures, Prop., Nevada
MVP Award. . . C++ / VB From an email received last week, from Amit Mohindra, of the VC++ team: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = There are flounder.com / mvp_tips.htm VC MFC Discussions Visual Studio (1) Windows 7 (1) Office (1) VB.NET (1) VBA (1) VB (1) UploadFile (1) JavaScript (1) Joe: Congratulations to you and Mike! - - David Wilkinson Visual C en-US / Vsexpressvc / threads - - David Wilkinson Visual C++ MVP There are more VC++ developers than VB or C#. Again, unclassified industry data. (Actually, this surprised me, because about ten years ago www.flounder.com / mvp_tips.htm stry data. s quite That doesnt sound right. I believe VB developers easily surpassed C++ 10 years ago. I would be surprised if thats not the the lead over C++. - - Ajay My mistake, according to this index, at least in 1985 (?) Vb was more popular than C++ - - Cholo Lennon Bs.As. ARG Most of the Microsoft forums make it go away :o) I'd be more scared to invest in learning much VB at this point. Not that it is going away or anything, but whenever I hear suspect that will continue to be the most growing syntax. Of course, C++ / CLI and VB and all the other #'s get the benefit of .NET improvements. Tom That may be
x3206 implicit truncation of vector type C++ / VB Ever since upgrading to the February 2010 Slimdx and equivalent DirectX SDK I have been messages anymore for some reason. Anybody else having this issue? Richard Win32 DirectX Graphics Discussions VB.NET (1) FromFile (1) DirectX (1) February (1) Graphics (1) Slimdx (1) Truncat (1) Vector throws up lots of similar errors as a result of this one Richy D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(703, 40): warning X3206: implicit truncation of vector type D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(753 39): warning X3206: implicit truncation of vector type D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(755, 18): warning X3206: 'mul': implicit truncation of vecto r type D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(755 11): warning X3206: implicit truncation of vector type D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(757, 23): warning X3206: 'mul': implicit truncation of vecto r type D: \ Backup \ VB.NET \ DirectX10 \ MyEditor \ bin \ x86 \ Debug \ Projects \ Terrain Test 2 \ Effect s \ TerrainOriginal.fx(757
Opening DLLs C++ / VB I have been given a DLL that I need to use in a VBS script it into a COM object he simply says that it works in C, C++ and VB !! Is there any method of using something like "LoadLibrary" or "LoadDLL" in VBS If so of hardware suppliers (and C affecianados)! he problem is even invoking a dll directly from vb is not the 'best' solution either but we live with it: part of the problem changes and leave you hanging if the calling interface changes. the good news is that VB Express is free and the executable does not, like vb6 come with gobs of baggage machine(s). The bad news is that MS took leave of their senses when developing VB.Net and made the learning curve a little to steep - though in general it is not that difficult esp. if you have already delved into the mysteries of vb script. Installing a VB.Net app is literally copying the exe (and making sure the clr is present). I They're also trying to "upsell" .Net and they are "de-emphasizing" VBS these days.) ?? "VB Express" is VB.Net, which is a JIT-compiled Java clone. It does not support