Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2009, 09:43 PM
Ivy Ivy is offline
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Double Byte in VB6.0

I have problem to write the double byte into text file.

c1 = int(a1) xor int(b1)
linetowrite = linetowrite + chrw(c1)

filed = app.path & "\aaa.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile (filed)

Set f = fso.OpenTextFile(filed, 8, True)
f.Write linetowrite -> problem occured here msg:Invalid Procedure or argument call

anyone can help me on this?
 
Old March 26th, 2009, 07:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi... maybe the file didn't open correctly???

Can you trace the objects to see if everthing happens ok?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old April 8th, 2009, 05:09 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I would add a reference to Windows Scripting Host, then change everything to:
Code:
    c1 = int(a1) xor int(b1)
    linetowrite = linetowrite & chrw(c1)
 
    Dim fso As New FileSystemObject
    Dim f   As TextStream
    filed = app.path & "\aaa.txt"
    Set f = fso.CreateTextFile(filed, True) ' The True is Overwrite.
 
    f.Write linetowrite
This causes all of the methods and members to be typed so you can see more easily any problems.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Does VB6 support double byte Asian Languages? tknnguyen Pro VB 6 2 August 19th, 2008 03:01 PM
Converting int to byte yukijocelyn C# 2005 1 May 30th, 2008 03:44 AM
convert byte[] to hex value gunjan.sh C# 2005 4 January 24th, 2008 05:15 AM
Byte alignment or byte padding subodh_chettri C++ Programming 0 June 23rd, 2006 10:35 AM
Printing byte[] safin XSLT 3 October 10th, 2005 07:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.