PLEASE HELP
======== script 1 ==================
set fso=createobject("scripting.filesystemobject")
set file=fso.createtextfile("file1.txt",2,true)
for i =1 to 10
file.writeline("this is line no "&i)
next
file.close
========script 2====================
set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("file1.txt",1)
set fso1=createobject("scripting.filesystemobject")
set file1=fso.createtextfile("file2.txt",2,true)
while not file.atendofstream
str=file.readline
wscript.echo str
file1.writeline(str)
wend
file.close
file1.close
===============================
It looks like you meant to use OpenTextFile with ForWriting (2) as the iomode,
with the create option enabled, in (default) ASCII mode. Instead you used
CreateTextFile with the overwrite option specified (2 is coerced to boolean
true) in Unicode mode. Then you read the Unicode file in ASCII mode and write it
out in Unicode again!
CreateTextFile Method
http://msdn.microsoft.com/library/en-us/script56/html/jsmthcreatetextfile.asp
OpenTextFile Method
http://msdn.microsoft.com/library/en-us/script56/html/jsmthopentextfile.asp
Windows Script Documentation
http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/728/msdncompositedoc.xml
--
Steve
Being defeated is often a temporary condition. Giving up is what makes it
permanent. -Marilyn vos Savant
"Rahul Verma" <raul...@hotmail.com> wrote in message
news:t_NV9.2703$IZ5....@nwrddc04.gnilink.net...
but VBscript still sucks in front of PERL
"Janne Saarinen" <janne.s...@disnet.fi> wrote in message
news:b09bd2$39q$1...@nyytiset.pp.htv.fi...
Yes, but what doesn't? ;-)
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
----------
Subscribe to Microsoft's Security Bulletins:
http://www.microsoft.com/technet/security/bulletin/notify.asp
"Curtis Anderson" <ned...@hotmail.com> wrote in message
news:uuJ0mtkvCHA.1656@TK2MSFTNGP09...
I once wrote an entire database in Perl using nothing but squiggles.
;-p
Curtis
As a far, far aside ...
But remember, the point of VBS language, like all
BASICs, is to be a general utility language, easily and
broadly recognizable. Users with even rudimentary
knowledge are supposed to be able to get an idea
of what is going on, and more knowledgable users
can learn from others' scripts. It's not supposed to
be a highly specialized and coded language. (It's not
even as specialized and coded as JScript.) Personally,
I don't even like like regexp (though it's obviously
necessary some of the time when it's applied),
because it runs against this grain.
Oh well, the daily ranting is over ...
Regards,
Joe Earnest
"Curtis Anderson" <ned...@hotmail.com> wrote in message
news:u3hvpOlvCHA.2596@TK2MSFTNGP12...
(By the way, you are absolutely correct. That isn't officially the point of the
language but it's pretty darned true anyway.)
"Joe Earnest" <joeea...@qwest.net> wrote in message
news:OH553nmvCHA.1644@TK2MSFTNGP12...
We're already so far off topic we may as well be in a different NG.... :-)
> We're already so far off topic we may as well be in a different NG.... :-)
Speaking of which ...
Has anyone seen a post from "name" lately.
I kinda miss his comet-like tours through
the newsgroup.
Regards,
Joe Earnest
If his English syntactic skills were better, he would always be a hilarious
poster - of course, then they would lose a certain bite. ;)
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
----------
Subscribe to Microsoft's Security Bulletins:
http://www.microsoft.com/technet/security/bulletin/notify.asp
"Joe Earnest" <joeea...@qwest.net> wrote in message
news:OahRYGnvCHA.1132@TK2MSFTNGP12...
Thanks. I'll check on Google. ;-)
Regards,
Joe Earnest
The scary thing is that sometimes I kind of understood what he was saying!
-Paul Randall
He does have his semi-coherent moments ;-)...
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
isn'ted cool , but biggest disadvantage of using perl in Win32 platform ,
since it is not raidly avabile as on unix and consume lot of resource.
"Joe Earnest" <joeea...@qwest.net> wrote in message
news:OH553nmvCHA.1644@TK2MSFTNGP12...
In my case, I've written several wrapper functions for FSO to make it dead easy
to read/write/append. Here's how I append data lines to a file. This is a
technique that completely wraps it up; this isn't "optimized", but it will work
adequately fast if you're not doing hundreds of thousands of line writes. The
best part is if you stick the procedure in your code library, it's a one-line
statement to append code.
AppendLine "C:\tmp\log.txt", "test"
Sub AppendLine(FilePath, sData)
'Given the path to a file, will append line sData to it
With CreateObject("Scripting.FileSystemObject")._
OpenTextFile(FilePath, 8, True, TristateUseDefault)
.WriteLine sData: .Close
End With
End Sub
"Rahul Verma" <raul...@hotmail.com> wrote in message
news:Qq3W9.573$e34...@nwrddc04.gnilink.net...
Ok. Yes, some languages are more self-contained and
less object-oriented. This was epitomized in pre-object-
oriented DOS days (or still exists in some aspects of
non-micro computing, specialized chips, etc.). In the
late 80's, MS decided to make object-orientation part
of the GUI-based operating system. The objects have
changed to greater or lesser degrees with the evolution
of Windows.
The advantages to object-orientation are that the language
is adaptive to OS/object changes and (importantly for a
non-compiled script) is lightweight and quick in operation.
Self-contained languages put more code between you
and the objects that they access. They are slower unless
compiled, and have greater difficulty in being compatible
across versions.
I agree that the syntax of many objects is obscure. But
the objects are designed for multiple-language access,
and the nuances are necessary to allow the object to be
used for different purposes. In some cases, I too, think
the object designers did a sloppy job. But object-
orientation is simply a fact of life today.
For what it's worth, even in DOS days, much of the
programming was being done in MASM or in a mix of
MASM and higher-level languages. The last versions of
QuickBASIC included the ability to effect MASM code
in compiled apps, and QuickBASIC was always capable
of importing MASM objects. MASM was necessary to
achieve some of the effects that object-orientation permits
(and more - like direct access to hardware). But *nothing*
is more obscure than strings of pure assembly language
command code bytes.
Joe Earnest
"Rahul Verma" <raul...@hotmail.com> wrote in message
news:Qq3W9.573$e34...@nwrddc04.gnilink.net...
| Thatz correct VBS is supposed general propose language as started , but
now
| days it is becoming more and more complex for example creating a file you
| have to write lengthy code
| set fso=createobject("scripting.filesystemobject")
| set file1=opentextfile("file1",1)
| as opposed to sweet Perl
| open(FD,"<file1")
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.410 / Virus Database: 231 - Release Date: 10-31-02
My neighbour bought an address book (mobile)
12KB memory, some hundreds of Dollars.
He cooked very good but was a little on the gay site.
I took him one look at my Visual Basic Programming Editor
and brand new Gateway < 100 MHz.
to say:
"Yes, but this is not case sensitive"
Trying to say, complaints about vbscript are either
masochistic or adhere to an veteranly MS world view.
I flew over the reponses to the thread and liked "semi-coherent moments"
----------------
To the post for "AVG anti-virus system".
yes I use it too and like it.
---
Y'all a nice wekend
"Rahul Verma" <raul...@hotmail.com> wrote in message
news:t_NV9.2703$IZ5....@nwrddc04.gnilink.net...
> Trying to say, complaints about vbscript are either
> masochistic or adhere to an veteranly MS world view.
>
> I flew over the reponses to the thread and liked "semi-coherent moments"
>
> ----------------
>
> To the post for "AVG anti-virus system".
>
> yes I use it too and like it.
>
> ---
> Y'all a nice wekend
>
>
Where ARE you from, name?
Your phrasing always has a hint of Asian elegance.