Login | |
|
 |
RE: Sub Within A Sub - 3/4/2006 3:03:17 PM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
you cant have a sub within a sub, if you want to do something like that its better to use a class instead
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/5/2006 9:34:24 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
I don't know that I would bother with a class for this. Just move the DC7600c sub so that it is not in the London sub. More importantly however, I think your logic needs to be looked at. You are calling every one of your location subs then checking within the sub to see if the location is correct or not. Instead, I would use a Select-Case statement to only call the location sub that really needs to be executed.
_____________________________
"... 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
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/6/2006 1:30:16 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Ok, so here's the thing. The whole purpose of the Call instruction is to discard anything that is returned by a function. So if you are calling a function using the call instruction, then there is no reason for it to be a function in the first place. Having said that, I agree that you probably want to make a GetLocation and GetMachine function. You should however be using the values that they return so you should call them thusly: strLocation = GetLocation() strMachine = GetMachine()
_____________________________
"... 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
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/6/2006 12:15:35 PM
|
|
 |
|
| |
Cybex
Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
|
Your right, I missed that lastnight when I posted. Cybex
_____________________________
Common sense is not so common.
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/6/2006 12:17:12 PM
|
|
 |
|
| |
Cybex
Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
|
So CJWallace, Did you get what you needed or are you still having issues? Cybex
_____________________________
Common sense is not so common.
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/7/2006 8:40:33 AM
|
|
 |
|
| |
Cybex
Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
|
Correct, what I posted was more pusdo code than anything. Just an idea... I will try and throw something together tonight if I can get a free moment. Cybex
_____________________________
Common sense is not so common.
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/9/2006 1:19:17 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
I think this may be a good time for a quick sitrep. Could you post the code that you are currently running, what it is not doing that you want it to do, and any errors?
_____________________________
"... 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
|
|
| |
|
|
|
 |
RE: Sub Within A Sub - 3/20/2006 11:43:48 PM
|
|
 |
|
| |
ginolard
Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
|
Check out the wonders of Select/Case True for this. Let's assume we have a variable called varCity and another called varMachine, our code would look something like this Select Case True Case varCity="London" And varMachine="1" Do stuff Case varCity="Milan" And varMachine="2" Do more stuff Case Else Do even more stuff End Select
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
|
|