Results 1 to 4 of 4
  1. #1

    Function with out parameter

    It is possible to create function with parameter that return value? I founded nothing in help.
    I need retrieve two values from function, One value function returned but another I want retrieve through parameter but I don't know how cretae function with out parameter.

  2. #2

    Re: Function with out parameter

    I am sure it is possible. Which scripting language are you using? It must be the same like in standard programming language. What exactly do you need?

  3. #3

    Re: Function with out parameter

    I use c# script language. When I try specify this function

    function MyFnc(param1, out param2)
    var obj;
    return obj;

    it is marked as error 100.

  4. #4

    Re: Function with out parameter


    The C#Script scripting language is based on JScript. JScript does not allow passing parameters by reference.
    To accomplish the task, you can pass an array to the function and change its elements or pass an object to it and change its properties.

    Below is a sample script demonstrating how to pass an array to a function and then use the modified value of an array element:

    <font class="small">Code:</font><hr /><pre>
    // C#Script

    function Test()
    var resArr = new Array(0);

    sum(2, 4, resArr);

    function sum(val1, val2, resArr)
    resArr[0] = val1 + val2;
    </pre><hr />
    Alex - SmartBear Support



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:38 PM.

Copyright BetaSoft Inc.