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

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 2018-02-28 14:55 +0100
Organization Aioe.org NNTP Server
Message-ID <p76dgp$c06$1@gioia.aioe.org> (permalink)
References <p7630h$1oem$1@gioia.aioe.org> <111hlmi5v5f3b$.hsodqzghvi2v$.dlg@40tude.net>

Show all headers | 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