SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: General Function Returning Multiple Values

    Try using CODE tags. Read this for info on UBB tags: http://www.qaforums.com/cgi-bin/foru...=ubb_code_page

    I am not sure I follow you, but you can reduce your code like this:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">INTEGER VerifyCopyPortAccessList ( )
    INTEGER sPAL = (MaxPort_Function ())
    Print &quot;Port Access List Is Set To {sPAL}&quot;
    return sPAL</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

  2. #2
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    General Function Returning Multiple Values

    I would like to write a function that can be used in multiple functions. I need a function that will take the value that is returned from the function below which can be any value.
    [-] INTEGER VerifyPortAccessList ( )
    [ ] INTEGER sPAL = Subscriber1.PortAccessList.GetText ( )
    [ ] return sPAL
    The problem I am having is finding a way to check for correctness, all I have been able to come up with is the following which is not what I am trying to do

    [-] INTEGER VerifyCopyPortAccessList ( )
    [ ] INTEGER sPAL = (MaxPort_Function ())
    [-] if sPAL == 1-10
    [ ] Print "Port Access List Is Set To 1-10"
    [ ] return sPAL
    [-] if sPAL == 1-2
    [ ] Print "Port Access List Is Set To 1-2"
    [ ] return sPAL

    I need to read the variable from the first function into the second function and somehow figure out if it is correct and then print the results and if it is incorrect logerror with the incorrect value. This sounds very confusing I know and if you have any questions let me know and I will try my best to explain more.
    Thanks
    scalo
    Scott Calo

  3. #3
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: General Function Returning Multiple Values

    Hi Chris, Thanks for the help here is what I came up with that is working,
    [-] STRING PortList_Function ()
    [ ] STRING sPort
    [ ] sPort = (Subscriber1.PortAccessList.GetText ( ) )
    [ ] Print ("Port List Is: { sPort}")
    [ ] return sPort
    [ ]


    [-] STRING VerifyCopyPortAccessList ( )
    [ ] STRING sPAL = (PortList_Function ( ))
    [ ] sleep (1)
    [ ] Print ("Port Access List Is Set To {sPAL}")
    [ ] return sPAL
    The problem that I have now is figuring out how to error check it since the value is not constant.
    Thanks for all the help
    Scott

    [ 06-23-2005, 12:48 PM: Message edited by: scalo ]
    Scott Calo

  4. #4
    Super Member
    Join Date
    Jul 2003
    Location
    Boulder, CO
    Posts
    1,276
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: General Function Returning Multiple Values

    Use a switch. 4Test doesn't require that you 'break' from each case like some other languages do.

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">STRING VerifyCopyPortAccessList ( )
    STRING sPAL = (PortList_Function ( ))
    sleep (1)
    Print (&quot;Port Access List Is Set To {sPAL}&quot
    switch sPAL
    case &quot;someProblem&quot;
    ....
    case &quot;anotherProblem&quot;
    ....
    case &quot;&quot;
    ....
    return sPAL</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    Chris R Mead

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

  5. #5
    Member
    Join Date
    Jun 2005
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: General Function Returning Multiple Values

    Thanks for all the help Chris, that is exactly what I needed.
    Scott
    Scott Calo

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 10:28 AM.

Copyright BetaSoft Inc.