fso is wrong! Please help! 
Author Message
 fso is wrong! Please help!

G'day, I used to be able to write valid xml using a fso but now it puts a
space between every thing and puts some funny characters at the start of a
stream. The output in the alert does not contain extra spaces but the file
does.

The offending characters are:         ?t
The out put goes like:        ?t < H T M L > < H E A D > < T I T L E > M o n
N o v   2 7   2 1 : 2 2 : 1 9   U T C + 1 1 0 0   2 0 0 0 < / T I T L E >

My code goes:
var rew=''";
var nameIz, extIz, fileIz, stream, Xcookie;
var ForAppending =  8;
var ForWriting  = 2;
var ForReading  = 1;
var hl=location.href;
wt=hl.split(":");
dRive=wt[1].replace(/\//g,"");
sap=new Array();
Qsap=new Array();
Qy=wt[2].toString();
sap=Qy.split("/");
for(x=0;x<sap.length-1;x++) {Qsap[x]=sap[x]};
var xref4=dRive+':'+Qsap.join("\\");
var here=xref4.replace(/%20/g," ")+"\\";

crystal = new ActiveXObject("Scripting.FileSystemObject");
nameIz=crystal.GetBaseName(here)
extIz=crystal.GetExtensionName(here)
fileIz=nameIz+"."+extIz
theFldr=crystal.GetParentFolderName(here);
function test() {
 alert("nameIz="+nameIz+"\nextIz="+extIz+"\ntheFldr="+theFldr)}

 var ddd=new Date;
 var dd=ddd.getDate()
 var ddm=(ddd.getMonth())+1;
 cookie=here+"\\dat_"+ddm+"_"+dd+".htm";
function writeIt() {
  stream = crystal.CreateTextFile(cookie, ForAppending, true);
 var divs=tab0.all.tags("DIV");
que=stream.WriteLine("<HTML><HEAD><TITLE>"+ddd+"</TITLE><link
rel=\"StyleSheet\" href=\"zxe.css\" type=\"text/css\" /><STYLE>B
{width:111;text-align:right} EM {width:222}</style></HEAD><BODY>");
 for(x=0;x<divs.length;x++) {
  var inX=divs[x].children;
  var yeppo='<HR />';
   for(y=0;y<inX.length;y++) {
if(inX[y].className=="p1"||inX[y].className=="p2"||inX[y].className=="p3")
{yeppo+="<B class=B"+y+">"+inX[y].value+"&nbsp;</B>"; }
if(inX[y].className=="p")
{yeppo+="<STRONG>"+inX[y].innerHTML+"&nbsp;</STRONG>";}
if(inX[y].className=="p0") {yeppo+="<EM>"+inX[y].innerHTML+"&nbsp;</EM>";}
   }
que=stream.WriteLine(yeppo);
rew+=yeppo
  }
que=stream.WriteLine("</BODY></HTML>");
  stream.Close();
alert(rew)
 }



Fri, 16 May 2003 03:00:00 GMT  
 fso is wrong! Please help!
Hi,
This appears to be a Unicode problem, try the following:
Instead of:
     stream = crystal.CreateTextFile(cookie, ForAppending, true);
Put:
     stream = crystal.CreateTextFile(cookie, ForAppending);

This should create an ASCII file instead of a Unicode file.

Rob.


Quote:
> G'day, I used to be able to write valid xml using a fso but now it puts a
> space between every thing and puts some funny characters at the start of a
> stream. The output in the alert does not contain extra spaces but the file
> does.



Fri, 16 May 2003 03:00:00 GMT  
 fso is wrong! Please help!
Thank-you, it works as it should, I will read up on this method a bit more.

Quote:
> Hi,
> This appears to be a Unicode problem, try the following:
> Instead of:
>      stream = crystal.CreateTextFile(cookie, ForAppending, true);
> Put:
>      stream = crystal.CreateTextFile(cookie, ForAppending);

> This should create an ASCII file instead of a Unicode file.

> Rob.



> > G'day, I used to be able to write valid xml using a fso but now it puts
a
> > space between every thing and puts some funny characters at the start of
a
> > stream. The output in the alert does not contain extra spaces but the
file
> > does.



Sat, 17 May 2003 11:01:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please, please help, I am desperated...:(

2. What am i doing wrong here????? HELP

3. What am I doin wrong..newbie needs help...

4. Please Help: Why am I now getting this error

5. Boy am I lost with this stuff - please help

6. Validation of fileds Please Help I am new.

7. PLEASE HELP PLEASE HELP PLEASE HELP

8. Help with JSCRIPT+ASP+FSO needed please

9. Please help - what is wrong here with msgBox?

10. What's wrong? help please

11. What's wrong, help please?

12. onkeypress - what am i doing wrong

 

 
Powered by phpBB® Forum Software