Solved

How do i transfer parameters in vbscript?

Posted on 2008-10-07
4
303 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

839 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