Solved

How do i transfer parameters in vbscript?

Posted on 2008-10-07
4
294 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>  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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now