SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2002
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I pass same parameter to multiple function

    I have a custom function that searches for an account number and then call other function to verify data. My question is " How can I pass this account number to other function without calling that function.

    ------------------

  2. #2
    Senior Member
    Join Date
    Oct 2001
    Location
    NC, United States
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I pass same parameter to multiple function

    depends.....how do you plan to execute the other function without calling it?????

    ------------------
    -gram
    -gram

  3. #3
    Junior Member
    Join Date
    Oct 2002
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I pass same parameter to multiple function

    Here is an example how I am calling the function:

    void funct1()
    string accountNumber= {logic to search account number}
    Verify_Account(accountNumber)

    //vefifyAccount function
    void Verify_Account (string accountNumber)
    --------
    --------
    call_function2(string somethingelse)

    //function2
    void call_function2(string somethingelse)
    ------
    ------
    Now How can I use variable AccountNumber in this function? Is there any way I can declare AccountNumber as global in funct1.

    ------------------

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I pass same parameter to multiple function

    No ... but you can declare it as global outside of any function. That is:

    Is that what you have in mind?

    Note that you could also simply define a second argument to call_function2 ... e.g.

    You can make the "acctno" argument "OPTIONAL" if you'd like ...

    This has the advantage of getting rid of global variables ... which is a matter of style and a whole different religious argument.


    ------------------


    [This message has been edited by Brent Rolland (edited 11-26-2002).]

 

 

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 07:32 AM.

Copyright BetaSoft Inc.