Find Jobs
Hire Freelancers

C# and MSScriptControl problem

max $5 USD

Closed
Posted about 21 years ago

max $5 USD

Paid on delivery
Hi all. I am using MSScriptControl to call a procedure written in VBScript. This is the body of this procedure: Function plus(aaa, bbb) aaa = aaa + 2 bbb = aaa + 2 plus = aaa end Function If I pass parameters aaa = 5 and bbb = 0 this function should return 7 and aaa should be 7 and bbb 9. I can pass parameters to this function and it returns proper value but values of parameters are still as they was before call. And I cant't figure out what's wrong in my code. Please help. Below is the C# code I used to call this VBScript. static void Main(string[] args) { ScriptControlClass scriptControl = new ScriptControlClass(); [login to view URL] = "VBScript"; [login to view URL]("Function plus(aaa, bbb)\naaa = aaa + 2\nbbb = aaa + 2\nplus = aaa\nend function\n"); //Initializing Parameters that will be passed to script int param1 = 5; int param2 = 0; object[] arguments = new Object[2]; arguments[0] = param1; arguments[1] = param2; string a = ""; try { a = [login to view URL]("plus", ref arguments).ToString(); } catch([login to view URL] e) { [login to view URL]([login to view URL]); [login to view URL]([login to view URL]); } // a must be 7 and it is. Function returns proper result [login to view URL](a); //param1 must be also 7, but it is 5 [login to view URL](param1); //param2 must be 9 but it still 0 [login to view URL](param2); I will give an excellent feedback for first programmer that can solve this problem. Attched is C# project ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 3) Complete ownership and distribution copyrights to all work purchased. ## Platform .NET
Project ID: 2917642

About the project

2 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
2 freelancers are bidding on average $4 USD for this job
User Avatar
See private message.
$4.25 USD in 14 days
5.0 (31 reviews)
5.1
5.1
User Avatar
See private message.
$4.25 USD in 14 days
5.0 (23 reviews)
4.6
4.6

About the client

Flag of UKRAINE
Ukraine
5.0
1
Member since Oct 8, 2001

Client Verification

Other jobs from this client

Need some PL/SQL help
$5-10 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.