Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


can't call a functionor sub ??

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> can't call a functionor sub ??
  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 >>
 can't call a functionor sub ?? - 2/10/2006 9:11:21 AM   
  ziminski

 

Posts: 79
Score: 2
Joined: 1/8/2006
Status: offline
sorry

< Message edited by ziminski -- 2/10/2006 9:26:00 AM >
 
 
Post #: 1
 
 RE: can't call a functionor sub ?? - 2/10/2006 9:29:17 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Dude...all I can say is WOW!. Pretty much any time you have a decision structure as large as the one you have and the question is 'Is there a simpler way?', the answer will almost always be yes. I don't know how much time I will have to look at it between now and Mondya, but here it is with formatting:

      

_____________________________

"... 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 ziminski)
 
 
Post #: 2
 
 RE: can't call a functionor sub ?? - 2/10/2006 9:51:00 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
I will make some general comments as I read through the code.

1) You don't need to recreate the FileSystemObject over and over again. Just create it once at the top of the script then use it wherever you need to.
2) You have the line 'File = objFile.Name' repeated in every one of your interior case blocks. If it needs to be executed for every case, then execute it before the select case...not in each case.
3) See #2 for the statement 'Set objFile = Nothing'
4) See #2 for the statements 'Call Makedir(nDir)' and 'Call CpFile(File)

Ok...I need to go now. I will try to look at this more later. Here is the code with the changes I mentioned. Obviously I couldn't test it so its possible I fat fingered something. Look it over thoroughly.

      

_____________________________

"... 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 ebgreen)
 
 
Post #: 3
 
 RE: can't call a functionor sub ?? - 2/10/2006 9:53:17 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
What are you sorry for? If what I said made you feel that you had something to apologize for then I should be apologizing to you. THis is a place for people to come and learn. If everyone here knew everything (and I definitely do not) then there would be no point in having the site. So in short, I am sorry to you. Please continue this discussion.

_____________________________

"... 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 ebgreen)
 
 
Post #: 4
 
 RE: can't call a functionor sub ?? - 2/13/2006 12:30:07 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
While I didn't see the original post, I would have to agree with ebgreen, there is no reason to apologize for posting code and asking for help.  Like I said in another recent post, looking at some of my code from when I first started makes me cringe.  It was bad and unfortunately I posted it in a usnet group.  

One of the hardest things to convey in a forum post, email, instant message, etc is tone.  In a conversation, be it face to face or on the phone, the tone of a message is fairly easy to pick up, you can tell when someone is being sarcastic, condescending, accusatory, sincere, etc.  But in the age of online communication this is much more difficult to pick up.  People will also perceive the tone of a post differently even if the original intent was that of an informative/helpful post.  With all that being said, to me, ebgreen's responses here are just like his responses in a large majority of his posts, helpful.  About the only thing I can see that would throw off someone is the "WOW".  But that could be attributed, remember I didn't see the original post,to the length of the post or the compexity of the script.  In my experience it would not be used in relation to the number of (for want of a better term) "mistakes" in the code.

As he said in his last post, we are here to help, so please post your code and lets continue this discussion.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to ebgreen)
 
 
Post #: 5
 
 
 
  

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 >> can't call a functionor sub ?? 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