The Mother Board

Motherboards.org forums. Free tech support, motherboard ID, and more.
It is currently Tue Sep 25, 2018 9:52 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: VBScript question
PostPosted: Tue Jan 27, 2009 1:28 am 
Offline
Black Belt 1st Degree
Black Belt 1st Degree

Joined: Mon Dec 29, 2003 10:35 am
Posts: 1092
Location: Trapped inside a virtual machine.
Hi, I'm a bit stupid and I'm not altogether brilliant at VBS anyway. My problem is a "name redefined" error. I think I understand what's happening, but my problem is with these lines:

Code:
const NumSourceFiles = 3
dim SourceFiles()
redim SourceFiles(NumSourceFiles)
SourceFiles(0) = "C:\test_source1\*.*"
SourceFiles(1) = "C:\test_source2\*.*"
SourceFiles(2) = "C:\test_source3\*.*"


This is part of a much bigger script. I'm trying to make a backup system. The problem seems to be that when the line dim SourceFiles(), it's then redefined in redim SourceFiles(NumSourceFiles) and VBS goes all funny. Any ideas?

_________________
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 27, 2009 1:33 am 
Offline
Mobo-fu Master
Mobo-fu Master

Joined: Sun May 06, 2001 12:01 am
Posts: 37463
Location: Netherlands
http://bizincusa.com/casp/html/vbscript ... tement.htm

_________________
We hate rut, but we fear change.
********************************
System error, strike any user to continue...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 27, 2009 1:36 am 
Offline
Black Belt 1st Degree
Black Belt 1st Degree

Joined: Mon Dec 29, 2003 10:35 am
Posts: 1092
Location: Trapped inside a virtual machine.
As far as I can tell, that's exactly what I'm doing. So why does the script not like it?

_________________
Home server: Asus P5Q Pro, Core2Quad, 8GB DDR2, ENGTX260 876MB, Zalman 800w, Antec P180 case, 2x1TB and 2x2TB Samsung Spinpoint F1, Windows 7 64-bit, etc

Work server: HP ProLiant ML350 G6, hexacore Xeon E5645 2.4GHz (12 logical cores), 16GB DDR3, 3x300GB SAS RAID5, Server 2008 R2, nVidia GT560Ti 1GB for Hyper-V RemoteFX acceleration


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 27, 2009 2:36 am 
Offline
Mobo-fu Master
Mobo-fu Master

Joined: Sun May 06, 2001 12:01 am
Posts: 37463
Location: Netherlands
check if you're not using

dim SourceFiles

without the () elsewhere. If you are, you're dimming twice which is illegal.

_________________
We hate rut, but we fear change.
********************************
System error, strike any user to continue...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group