Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: Sub Within A Sub

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Sub Within A Sub
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: Sub Within A Sub - 3/21/2006 12:18:50 AM   
  ginolard


Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
Well, yes, varCity and varMachine were merely examples.  You need to define your own variables ;)

_____________________________

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

(in reply to cjwallace)
 
 
Post #: 21
 
 RE: Sub Within A Sub - 3/21/2006 12:22:23 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Ahhhhhhhhhhhhh thought so.

I am still very new to scripting is there anyway you can help me with this one.

Cheers

(in reply to ginolard)
 
 
Post #: 22
 
 RE: Sub Within A Sub - 3/21/2006 12:22:58 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
This may not be right either, but it has a beter chance of actually running...


      


Cybex

_____________________________

Common sense is not so common.

(in reply to cjwallace)
 
 
Post #: 23
 
 RE: Sub Within A Sub - 3/21/2006 12:26:02 AM   
  ginolard


Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
Cybex's code should work

_____________________________

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

(in reply to Cybex)
 
 
Post #: 24
 
 RE: Sub Within A Sub - 3/21/2006 12:42:56 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Guys.........you really are just the best.

That works a treat and gives me a platform to move forward with.

Again thanks very much

(in reply to ginolard)
 
 
Post #: 25
 
 RE: Sub Within A Sub - 3/21/2006 12:53:56 AM   
  DiGiTAL.SkReAM


Posts: 1152
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: online
quote:

ORIGINAL: cjwallace
I am still very new to scripting is there anyway you can help me with this one.


This from the user with 336 posts on a vbscripting forum. lol


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to cjwallace)
 
 
Post #: 26
 
 RE: Sub Within A Sub - 3/21/2006 1:36:05 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
ha ha ha

Yes its becuase over the last year i have posted alot of posts on how to do stuff.

I am still very much a newbie.


You guys give so much help that i really hope to be giving it back once i can

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 27
 
 RE: Sub Within A Sub - 3/21/2006 1:40:19 AM   
  ginolard


Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
We were all newbies once.  I look back at some of my early scripts and shudder.

_____________________________

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

(in reply to cjwallace)
 
 
Post #: 28
 
 RE: Sub Within A Sub - 3/21/2006 1:50:31 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I look back at last weeks and shudder...


Cybex

_____________________________

Common sense is not so common.

(in reply to ginolard)
 
 
Post #: 29
 
 RE: Sub Within A Sub - 3/21/2006 4:06:45 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Thanks guys.

Ok i have one small issue and i really dont know if it can be solved

Please see the part in bold. Basically that number changes from machine to machine is there some way the script can ignore that part and only take the part
that reads HP Compaq dc7100 SFF


I am really not sure this can be done? 



      


Thanks for any help on this

(in reply to Cybex)
 
 
Post #: 30
 
 RE: Sub Within A Sub - 3/21/2006 8:44:26 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I don't think you need the two Cases for london if they do the same thing.  This way would just look for the "DC7600" or "DC7100".

UNTESTED, CHECK TO MAKE SURE THE INSTR() IS SETUP RIGHT.

      

If it works you can use it in the other Case statements.

Cybex

< Message edited by Cybex -- 3/21/2006 8:45:32 AM >


_____________________________

Common sense is not so common.

(in reply to cjwallace)
 
 
Post #: 31
 
 RE: Sub Within A Sub - 3/21/2006 8:56:59 AM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hello mate. Thanks for the reply.

I have just jumped on to my work PC to test this but when i run it i get

Line 12

Char 1

Error: Invalid Procedure call or argument: 'InStr'

Any ideas?

Thanks again for your help so far

(in reply to ginolard)
 
 
Post #: 32
 
 RE: Sub Within A Sub - 3/21/2006 12:09:29 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I told you it was untested...

Tested

      


Cybex

< Message edited by Cybex -- 3/21/2006 12:24:42 PM >


_____________________________

Common sense is not so common.

(in reply to cjwallace)
 
 
Post #: 33
 
 RE: Sub Within A Sub - 3/21/2006 9:53:45 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Hi cybex. Thanks for the reply and great news the script above work a treat which is nice.

Thanks so much for your help.

I have one small issue.

Please see the section in bold. I had to change the code for that part back to what we had before to get it to work and that is no big deal to be honest.

Now the machine EVO works fine when you run the script but when you run the code below on a Evo D510 SFF it returns that it is a unknown machine in an unknown city. But and please see the BUT section of this post

Ok here is the code so far


           

BUT section

if i run the code below it tells me what machine i am?


      

Any ideas as to what it might be?

Thanks for your help so far mate

(in reply to Cybex)
 
 
Post #: 34
 
 RE: Sub Within A Sub - 3/21/2006 10:11:02 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Read the script I posted.

InStr(LCase(varMachine), "d530")
You didn't use this part.

Your added code should be like this:
Case LCase(varCity) = "london" And InStr(LCase(varMachine), "d530") <> 0


Also keep in mind that you InStr search is case sensistive.  That why I used LCase(), so make sure the string you put in quotes to search fore is loweer case.

Updated code to include the D510 for London and the Geneva 7100.

      


Cybex

_____________________________

Common sense is not so common.

(in reply to cjwallace)
 
 
Post #: 35
 
 RE: Sub Within A Sub - 3/21/2006 10:27:54 PM   
  cjwallace

 

Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Thanks Cybex its all working now.




Thanks for all your help mate

(in reply to Cybex)
 
 
Post #: 36
 
 
Page:  <<   < prev  1 [2]
 
  

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 >> RE: Sub Within A Sub Page: <<   < prev  1 [2]
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