SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Sep 2001
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing parameters into function

    I have to pass about 40 parameters into a function.Is there any way not to write them all on the same line?
    Could I use some delimeter to carry parameters over to the next line?

    E.g.
    Instead of:
    void UserInfo(STRING sTitle,STRING sFName, STRING sLName,STRING sCity ....)

    void UserInfo(STRING sTitle,
    STRING sFName,
    STRING sLName,
    STRING sCity )

    Thanks

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

  2. #2
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    I would use a record:

    ------------------
    David Genrich
    david.genrich@e2open.com
    david@linuxpuppy.net

    [This message has been edited by davidgenrich (edited 05-23-2002).]

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    David,

    I have to use this funcion for different testcases and some fields in the record can be optional, so I decided to use function with parameters(not assign value in record)

    Thanks


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

  4. #4
    Senior Member
    Join Date
    Oct 2000
    Location
    Laurel, Maryland, USA
    Posts
    204
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by gkalika:
    David,

    I have to use this funcion for different testcases and some fields in the record can be optional, so I decided to use function with parameters(not assign value in record)

    Thanks


    <HR></BLOCKQUOTE>


    As David did I would definitely recommend going with a record rather than individual parameters.

    Aside from that, if you hold down the shift key when you hit return you will get the results you would like. You can they enter information on multiple lines and Silk will treat them as one line.


    ------------------
    Atlee
    Atlee

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    One solution is to spawn one line into multiple lines, but this is messy.

    If you have optional variables, you can still use the RECORD type by not using the varaibles that are optional. In any event you need to handle optional variable in the function anyways, because you can't assume when a variable is optional if you want to make a generic function. Otherwise you are making a specialized function, hence more reason to just throw in the RECORD type.

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

  6. #6
    Junior Member
    Join Date
    May 2001
    Location
    Sophia-Antipolis, France
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    To spawn a line into multiple lines, you can press Shift + <enter>

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

  7. #7
    Junior Member
    Join Date
    May 2001
    Location
    Sophia-Antipolis, France
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    Sorry,

    To spawn a line into multiple lines, you can press Shift + <enter>

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

  8. #8
    Junior Member
    Join Date
    May 2001
    Location
    Sophia-Antipolis, France
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Passing parameters into function

    I don't know why, but the end of my message is not displayed. Last try:

    To spawn a line into multiple lines, you can press Shift + the enter key

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

 

 

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:46 AM.

Copyright BetaSoft Inc.