SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Can a function return an array?

    User Allan Ventrup Forsmark (avf@newtech.dk.nospam) posted:

    Hi,

    How is the syntax if I a function must return an array?

    regards,
    Allan Forsmark

    ---

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User Elena Pevzner (elenapevzner@yahoo.com.nospam) posted:

    You can't do it. The only thing you can do is passing
    an array to a function as a parameter. Do whatever you
    like with the parameter and after function exits, you
    can get the right array.

    Elena

    --- Allan Ventrup Forsmark <avf@newtech.dk> wrote:
    leave-sqa-suite-users-9233366V@lyris.dundee.net


    __________________________________________________

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User rjpowers (rjpowers@townisp.com.nospam) posted:

    You cannot have a function return an array.

    But SQA basic by default, passes values by reference. Therefore if you pass
    a reference to a empty array and fill that array in your function you can
    accomplish the same result.

    Richard


  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User Michael Atherton (michael.atherton@mercia.com.nospam) posted:

    The other option you have is if you don't want to bother passing
    arrays you could declare the array at a global level. It's not the
    best programming technique, but if you are careful with the calls to
    the array you shoulden't have any problems and gets around all of the
    problems with passing arrays.


  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User (david.marsh@gb.abb.com.nospam) posted:

    --0__=80256B64004C65FF8f9e8a93df938690918c80256B6400 4C65FF
    Content-type: text/plain; charset=us-ascii


    Or shove it into a text file,

    (Embedded Michael Atherton <michael.atherton@mercia.com>
    image moved 18/02/2002 13:49
    to file:
    pic17035.pcx)


    Please respond to "SQA Suite Team Test Users"
    <sqa-suite-users@lyris.dundee.net>

    To: "SQA Suite Team Test Users" <sqa-suite-users@lyris.dundee.net>
    cc:
    Subject: RE: Can a function return an array?

    Security Level:? Internal


    The other option you have is if you don't want to bother passing
    arrays you could declare the array at a global level. It's not the
    best programming technique, but if you are careful with the calls to
    the array you shoulden't have any problems and gets around all of the
    problems with passing arrays.


  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User Paulo Ricardo Tatsch Dutra (paulod@dbserver.com.br.nospam) posted:

    Or return just one string with all elements with a delimiter ( ";", "%",
    "%^%", ... ). In the routine that you called the function, you can use the
    SPLIT (of VB) function to change on a array !

    Paulo Dutra.


  7. #7
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can a function return an array?

    User MArk B. (mkbutler@russellmellon.com.nospam) posted:

    Like cloning Elvis, some things can be done but shouldn't be.

    Go ahead and use all the globals you want. But every time you do, think
    about all of those Elvis impersonators you'd be putting out of work. Pretty
    soon you'll be asking yourself which one is the "real" Elvis. And then
    which particular Elvis do you want of the many there will be? You going for
    the black and white Elvis? Maybe the one that came to the worlds fair in
    Seattle? Which of the many beach bum Elvi are might you be talking about?
    Can you be sure you got the right one and that someone didn't substitute the
    wrong Elvis on you? You just might end up with the sweat covered chubby one.

    Viva Las Globals!

    MArk B.
    Like he said, "It's not the best programming technique..."

    "Michael Atherton" <michael.atherton@mercia.com> wrote in message
    news:95379@sqa-suite-users...
    ---

 

 

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 13.64%
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 09:20 AM.

Copyright BetaSoft Inc.