Solved

How do i transfer parameters in vbscript?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
passing enum to a method 4 51
Active directory security group with Modify access need to apply on created new folders 7 75
JDBC performance 8 35
Java List 4 76
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 …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

734 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