Solved

How do i transfer parameters in vbscript?

Posted on 2008-10-07
4
302 Views
Last Modified: 2013-11-23
Hi Experts,
i have 2 questions.
1. How do i create a vbscript that get 5 numbers calculate there Sum and there multiplying and then return the result?i want to run this script from java and i don't know how.
can you please help me with the vbscript and the java?

2. I creaet a class in vbscript, how do i use this class and is function in other vbscript?
0
Comment
Question by:ExpandNetworks
  • 2
4 Comments
 
LVL 2

Expert Comment

by:mensoid
ID: 22662933
Is this for a website, or stand alone app? in other words are you looking for a vbs file or a vbscript function in a web page?
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22663532
Hi, for adding another script into an existing script, you can use something like this.

Regards,

Rob.
IncludeFile "C:\Temp\Functions.vbs"
 
Sub IncludeFile(strScript)
   Dim FSO, ScriptFile
   Const intForReading = 1
   Set FSO = CreateObject("Scripting.FileSystemObject") 
   Set ScriptFile = FSO.OpenTextFile(strScript, intForReading, False) 
   ExecuteGlobal ScriptFile.ReadAll
   ScriptFile.Close
   Set ScriptFile = Nothing 
   Set FSO = Nothing
End Sub

Open in new window

0
 

Author Comment

by:ExpandNetworks
ID: 22667211
Hi
for my first questioni am lokking for a stand alone vbscript. this script should be executed from java, send it 5 numbers and return to the java 2 results, and i want to use this results in my java code.
i need help with the vbscript and the java code

Rob,
aboute your comment from what i know this will run the include vbscript but the include vbscript is a class with functions and i want to create a instanse of this class in my vbscript and use all is functions.

Thanks
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 250 total points
ID: 22674087
>>  the include vbscript is a class with functions and i want to create a instanse of this class in my vbscript and use all is functions

As far as I know this should still work....using ExecuteGlobal, you are effectively embedding the other VBScript file into your current one, so after that ExecuteGlobal statement, you should be able to create an instance of that class.....

Regards,

Rob.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question