Function with many (> 20) Parameters

Kromozone
Kromozone Member Posts: 47
Hallo!

very simple question: I've just created a Function with many Parameters. If i want to compile, i get the Message "Reduzieren Sie den Ausdruck, so daß er weniger komplex ist" and the Cursor jumps to the 19th Parameter of the Function Call.

I guess i have too many Parameters, but i could not find anything about this Message. Can you acknowledge this?

Kindly Regards & Greetings from Germany
Andy

Comments

  • kine
    kine Member Posts: 12,562
    From my experience - Navision is able use functions only with max. 20 parameters... documentation say nothing about it, but I have confirmed it with NTR...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Kromozone
    Kromozone Member Posts: 47
    Too Bad :cry: Thank you!

    Andy
  • janpieter
    janpieter Member Posts: 298
    I would recommend a restructuring of your programming if you need 20 parameters ...

    I have never programmed functions with over 10 parameters as far as i can remember ...
    In a world without Borders or Fences, who needs Windows and Gates?
  • ajhvdb
    ajhvdb Member Posts: 672
    janpieter wrote:
    I have never programmed functions with over 10 parameters as far as i can remember ...
    As far as I can remember not more then 8, does this mean... :lol:
  • medost
    medost Member Posts: 10
    Hi,
    starting a function wth more than 10 parameters is very strange.

    Why you do not use temporary tables?
  • kine
    kine Member Posts: 12,562
    for example when creating some text file for export, I need to call function with 30 parameters (30 fields) but i have no table with these fields because they are from more tables....... This function take these 30 values and generate new line into file in some way....
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RobertMo
    RobertMo Member Posts: 484
    What about setting one parm that is actually an array ? This way you can send practicaly unlimited parms.

    the only limitation is that you have the same type of all variables. this can be solved if you have several arrays of different types as parms...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Kromozone
    Kromozone Member Posts: 47
    @kine
    right, exactly this is the reason ;)

    Thank you all... I've found a cleaner solution for my problem! :roll: