Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11874

Re: Something rather odd: results change by adding blank lines to the code

Path csiph.com!aioe.org!.POSTED!not-for-mail
From "R.Wieser" <address@not.available>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: Something rather odd: results change by adding blank lines to the code
Date Wed, 28 Feb 2018 14:55:29 +0100
Organization Aioe.org NNTP Server
Lines 27
Message-ID <p76dgp$c06$1@gioia.aioe.org> (permalink)
References <p7630h$1oem$1@gioia.aioe.org> <111hlmi5v5f3b$.hsodqzghvi2v$.dlg@40tude.net>
NNTP-Posting-Host OLAqPNFqcmhJ7HE1wtUANg.user.gioia.aioe.org
X-Complaints-To abuse@aioe.org
X-RFC2646 Format=Flowed; Original
X-MSMail-Priority Normal
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority 3
X-Newsreader Microsoft Outlook Express 6.00.2900.5512
X-Notice Filtered by postfilter v. 0.8.3
Xref csiph.com microsoft.public.scripting.vbscript:11874

Show key headers only | View raw


JJ,

> Specify the ASCII format when opening the file.

Yeah, tried that too.  Didn't work though.  Thats when I noticed the rather 
bizarre behaviour.

> Otherwise, by default, WSH will try to detect the file format, which
> is not 100% guaranteed to be accurate.

Are you sure about that detecting bit ?   The 'opentextfile' docs only allow 
me to select either ANSI or Unicode (or use the systems default, which, in 
my case, seems to be ANSI) ...


But, the cause has been found !

According to my stumbled-over google results ReadAll does not play well with 
non-ANSI content, and although it creates a string large enough to hold the 
files contents, it only fills it partially (upto the first zero I presume) 
leaving the rest of the buffer untouched and filled with .. whatever was 
there when the string space was allocated.    Hence the changing results.

Regards,
Rudy Wieser

Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Something rather odd: results change by adding blank lines to the code "R.Wieser" <address@not.available> - 2018-02-28 12:15 +0100
  Re: Something rather odd: results change by adding blank lines to the code Wally W. <ww84wa@aim.com> - 2018-02-28 08:05 -0500
    Re: Something rather odd: results change by adding blank lines to the code "R.Wieser" <address@not.available> - 2018-02-28 15:14 +0100
  Re: Something rather odd: results change by adding blank lines to the code JJ <jj4public@vfemail.net> - 2018-02-28 20:25 +0700
    Re: Something rather odd: results change by adding blank lines to the code Wally W. <ww84wa@aim.com> - 2018-02-28 08:38 -0500
    Re: Something rather odd: results change by adding blank lines to the code "R.Wieser" <address@not.available> - 2018-02-28 14:55 +0100
  Re: Something rather odd: results change by adding blank lines to the code "Mayayana" <mayayana@invalid.nospam> - 2018-02-28 10:01 -0500
    Re: Something rather odd: results change by adding blank lines to the code "R.Wieser" <address@not.available> - 2018-02-28 17:16 +0100

csiph-web