Announcement

Collapse
No announcement yet.

advanced Functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • advanced Functions

    Hi,

    Just trying to get to grips with 4DGL and I have a few questions about functions, mostly due to my coding style with other languages.

    1. Can functions be overloaded?
    2. Can functions have optional parameters?
    3. Can functions parameters have default values?

    If not are there any workarounds or clever tricks that may mimic this functionality.

    Thanks in advance for any help,
    Neil

  • #2
    Hi coylen,

    Of course there is always a workaround to achieve the functionality that you want.

    You can check the 4DGL Programmers Reference Manual that will give you an insight about the language.
    http://www.4dsystems.com.au/productp...nual_R_5_3.pdf

    It's very easy and very simple to learn with the combined elements of C, Basic and Pascal language.

    Regards,
    Last edited by jamespaulpena; 24th March 2017, 03:49 PM.

    Comment


    • #3
      4DGL is designed to be a simple easy to learn language, the concepts you have described are too complex to fit in its design criteria.

      You can simply do what you want in slightly different ways, say

      Code:
      func abcd(var a, var b, var c)
      endfunc
      
      func abcd1(var a)
          abcd(a, 123, 4) ;
      endfund
      
      func abcd2(var a, var b)
          abcd(a, b, 4) ;
      endfunc
      It only takes a few seconds and is actually clearer to understand
      Mark

      Comment

      Working...
      X