a = a & tsIn.Readline - no output 
Author Message
 a = a & tsIn.Readline - no output

I use the following lines of code to read a whole file in a local variable.
But msgbox a has no results (when the file is quite large).
Why? Who can help? Is there any limitation  for a local variable?
Thanks for any help!
Micha

function GetBody(file)
 dim fs
 dim tsIn
 dim a

 Set fs = CreateObject("scripting.filesystemobject")
 Set tsIn = fs.opentextfile(file, 1)

 Do While tsIn.AtEndOfStream <> True
  a = a & tsIn.Readline
 Loop
 tsIn.Close
 msgbox a
end function



Fri, 13 Dec 2002 03:00:00 GMT  
 a = a & tsIn.Readline - no output

My guess is that you may have a script timeout in effect (maybe from a
WSH file used to launch the script) that causes it to terminate before
it has finished reading the file.


: I use the following lines of code to read a whole file in a local
variable.
: But msgbox a has no results (when the file is quite large).
: Why? Who can help? Is there any limitation  for a local variable?
: Thanks for any help!
: Micha
:
:
:
:
:
: function GetBody(file)
:  dim fs
:  dim tsIn
:  dim a
:
:  Set fs = CreateObject("scripting.filesystemobject")
:  Set tsIn = fs.opentextfile(file, 1)
:
:  Do While tsIn.AtEndOfStream <> True
:   a = a & tsIn.Readline
:  Loop
:  tsIn.Close
:  msgbox a
: end function
:
:
:



Fri, 13 Dec 2002 03:00:00 GMT  
 a = a & tsIn.Readline - no output
To start with, MsgBox has a limit of ~1023 characters...

Any chance the file contains embedded nulls (chr(0))?  MsgBox truncates text at the first embedded
null character...

--
Michael Harris
MVP Scripting

I use the following lines of code to read a whole file in a local variable.
But msgbox a has no results (when the file is quite large).
Why? Who can help? Is there any limitation  for a local variable?
Thanks for any help!
Micha

function GetBody(file)
 dim fs
 dim tsIn
 dim a

 Set fs = CreateObject("scripting.filesystemobject")
 Set tsIn = fs.opentextfile(file, 1)

 Do While tsIn.AtEndOfStream <> True
  a = a & tsIn.Readline
 Loop
 tsIn.Close
 msgbox a
end function



Fri, 13 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. a = a & tsIn.Readline - no output

2. ppml consumer for b&w output

3. AdobePS 5.0 for NT 4.0 & Linotronic output

4. Mac&StyleScript&EPS&ClarisWorks&Ill7

5. Outputting Files & changing the extensions

6. Parallel Input & Output

7. PB 64k limit & output limit

8. ODBC api & stored proc output parms

9. Newbie Question - Binary output & program flow

10. Very Frustrated Newbie - Write & Output, HELP

11. Sources for Input/Output Hardware & Software

12. ODBC api & stored proc output parms

 

 
Powered by phpBB® Forum Software