Solved

How do i transfer parameters in vbscript?

Posted on 2008-10-07
4
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

756 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