Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Expected identifier when trying to delete file

Expected identifier when trying to delete file

2004-04-26       - By Will Mendez

 Back
Reply:     1     2     3     4  

Hey Bernard,

instead of  fso.delete( oToRemove );

use

fso.deleteFile( oToRemove );

see if that helps.

/Will




-- --Original Message-- --
From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf
Of Bernard Lebel
Posted At: Monday, April 26, 2004 3:56 AM
Posted To: xsi
Conversation: [Script] Expected identifier when trying to delete file
Subject: [Script] Expected identifier when trying to delete file


Hello,

I've done this many this many times, but now for the life of me I can't make
it work. I'm trying to delete a file using a FileSystemObject, and the
script always barfs an error "expected identifier". But the thing is I CAN
get the file, but deleting it doesn't work! The error occurs at the
fso.delete( oToRemove ) line.

for( var j = new Enumerator( oFolderColl2 ); !j.atEnd(); j.moveNext() )
{
   var oFolder = fso.getfolder( j.item() );
   var oFiles = oFolder.files;

   if( oFiles.count > 0 )
   {
       for( h = new Enumerator( oFiles ); !h.atEnd(); h.moveNext() )
       {
           var oFile = fso.getfile( h.item() );
           var sFileName = oFile.name;

           if( sFileName.match( /(.tyy)/ ) )
           {
               oFileColl.add( oFile );
           }
       }
   }
}

if( oFileColl.count > 0 )
{
   for( var i = new Enumerator( oFileColl ); !i.atEnd(); i.moveNext() )
   {
       var oToRemove = fso.getfile( i.item() );
       // Troublesome line
       fso.delete( oToRemove );
   }
}







Thanks

Bernard
---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi

---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi