SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to pass parameters to dynamic functions?

    I don't know if this can be done, but I wanted to know if anyone knows of a way to pass parameters to a dynamic function in 4Test. For example:

    Object1.@(''Func_name'')()
    works under 4Test, but

    Object1.@(''Func_name'')(1,''2'')
    does not work.

    Does anyone know how to get a dynamic function to accept parameters like this, or am I stuck with 0-parameter dynamic functions?

    Thanks in advance,

    Fraser Gordon
    Automated Test Engineer

  2. #2
    Guest

    Re: How to pass parameters to dynamic functions?

    Have you taken a look at ArgListCall?

    Description

    Equivalent to a function or method call.

    Syntax

    Ret = ArgListCall (sName, argList)

    Variable Description
    Ret The return value of the function or method called.
    sName The name of the function or method to be called. STRING.
    argList The list of arguments that the function or method takes. LIST.

    Notes

    You can use ArgListCall to call a function or method by specifying the function or method name and its arguments as arguments to ArgListCall. This allows you to define fully data-driven tests, where you can pass in the names of the functions and methods you want to be called.

    Grabbed this information from the online help (there are examples there).



  3. #3
    Junior Member
    Join Date
    May 2000
    Location
    Bedford, MA, USA
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass parameters to dynamic functions?

    How about a list or record of type ANYTYPE?
    list of anytype myParam={ 1, ''two''}
    Object1.@(''Func_name'')(myParam))
    myParam={}
    Object2.@(''Func_name'')(myParam)

    Func1( list of anytype)
    {
    if ( listcount(x) > 0 )
    for ( i=1; i<= listcount(x); i++)
    print (''x[{i}] is type : {TypeOf(x[i])}'' )
    print(''x[{i}] ={x[i]} '')
    }
    Func2( list of amytype)
    {
    print(''ignore param'')
    }

    Will this come close to solving it?

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass parameters to dynamic functions?

    main ()
    {
    STRING sFunction = "DoubleNumber";
    INTEGER iNumber = 3;
    @(sFunction) (iNumber);
    Print (iNumber);
    }
    DoubleNumber (inout INTEGER iNum)
    {
    iNum = iNum * 2;
    }

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:47 AM.

Copyright BetaSoft Inc.