Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to VBScript 1

Status
Not open for further replies.

thelke

MIS
Apr 9, 2002
84
I am writing a VBScript, and it could contain a couple thousand lines of code. I am new to this, and would like to know 1. Is there a realistic limit to the number of lines the code may contain, and 2. would there be an easier way (not specificaly pertaining to this script) that I could have multiple scripts and have 1 main script that calls the other scripts? I would like to make this a fast script, and not sure it having hundreds of functions in 1 script would be efficient, instead of multiple scripts with calls to the other functions.

If I wanted to do calls, how would I do that? I am new to scripting, and would need a detailed walk-thru.

Thank you.
 
You could try looking at .WSF files "Windows Scripting files " these are XML based and you can split your code into subs within other programs.

Try searching Microsoft on .WSF files, hopefully this will give you something to look into before someone else who is a lot better at VBscript can answer your question in more detail.

If you don't have any responce from someone else by tomorrow morning (UK time) I will endeavour to send you some examples.
Regards
Steve Friday
 
OK here you go very simple program to show a preset message

This file should be saved as a .WSF

<PACKAGE>
<JOB ID=OUTGOING_DOC_CONTROLLER>
<SCRIPT LANGUAGE=&quot;VBScript&quot; SRC=&quot;steve2.vbs&quot; />
<SCRIPT LANGUAGE=&quot;VBSCript&quot;>
Option Explicit
showmsg &quot;test message&quot;
</SCRIPT>
</JOB>
</PACKAGE>


This file should be saved as a VBS you can see from above that I called mine steve2.vbs.

Private sub showmsg(msgtext)
msgbox msgtext
End Sub

Run the WSF file by double clicking on it, you will see that the WSF calls the Sub Showmsg passing across the message.

Hope it helps

Steve
Regards
Steve Friday
 
Thanks, I used that exaple to do what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top