Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Calling Functions

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,52291
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Calling Functions
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Calling Functions - 9/28/2007 1:44:19 AM   
  mcds99


Posts: 434
Score: 4
Joined: 2/28/2006
Status: offline
Before I try this I want to know how stupid I might be.

I know "box of rocks".

I'm attempting to manage (delete) some zero "0" length files (3957) on a UNIX system that have accumulated over time.
The file name extensions are specific and are in a specific order, there are 7 filename extensions.
I'm just going to do the text processing on the Windows side and FTP the script to be run back to the UNIX system.

I have a Function that reads the file name from the spreadsheet that contains the output from ls -ltr (dir on UNIX)
I'll split the file name and determine the if the name gets written to the text file that will be the script to delete the files.

Can I call that Function from within itself? 

This is not complete code as I want to know if what I proposing is beyond stupid...

      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF
 
 
Post #: 1
 
 RE: Calling Functions - 9/28/2007 1:47:28 AM   
  ebgreen


Posts: 5032
Score: 31
Joined: 7/12/2005
Status: online
Without going into your specific situation, you certainly can call the function from within the function. This is called recursion.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 2
 
 RE: Calling Functions - 9/28/2007 2:40:23 AM   
  mcds99


Posts: 434
Score: 4
Joined: 2/28/2006
Status: offline
Thanks ebgreen.

I'm in the process of inheriting an application support position. There are some maintenance issues on the test side.
This application has Main Frame, UNIX, and Windows all interfacing, files get copied all over the place. There is some code
that's outside the application that doesn't cleanup after itself and they wont change it.

I really don't want to do an "rm xyz0788465597089854646.ext" on 3900 + files a few at a time.

Just to make it interesting I have to leave specific files that are grouped, the business side wants them. 8-O

I'm going to read 2 file names from the list, determine the file name extensioin of the first and second file names.
If the first file name extension is (lets say) george and the second file name extension is john I'll write them to a file
that will become the script and delete them, If the names are ringo or paul I'll just leave them alone.

This wont be a one time operation I'll be able to use the script when I see the directory getting lots of these files in it.
It will be a maintenance tool.

It's an odd situation and the names have been changed to protect my job ;-)


Sam.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Calling Functions Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts