Alpha Video Training
Results 1 to 6 of 6

Thread: Skip parameter in UDF

  1. #1
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Skip parameter in UDF

    If a udf is defined as
    function myfunc as v(param1="abc", param2=.t.)

    I seem to recall discussion about an enhancement that would let the udf be called with
    myfunc(,.f.)
    where skipping parameter would leave param1 with the default value of "abc". In v7 beta this still gives a syntax error. Is this something that is being considered? It would sure belpful for longer parameter strings where you just need to set a parameter at the end.

    Bill.

  2. #2
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default

    Bill,

    I believe that may be me. I asked for that as far back as version 4.

    I've also asked for arg0 (name of the function), # of passed parameters, and flags to indicate if an argument is null or not.

    However, I do have a way to get arg0 and the number of parameters, but it is a bit of a kludge. I can also skip the parameters, but have to put some type of argument in, as in

    functionname(.t.,.t.,arg3)

    or

    functionname("","",arg3)
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  3. #3
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default

    But if you do that kind of skip, the function must be defined with arguments of type A, so you can convert in the function. It would sure be nice for the popup help to show type N and L where needed.

    Bill.

  4. #4
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default

    Bill,

    Exactly correct. So if you look at my universal functions, almost all arguments are type A.

    But even better would be to allow our own popups and choice definitions. I had suggested to Selwyn to allow a special line (similar to DESCRIPTION) that would specify a function call that would return character strings that would be substituted in as the argument value, e.g.

    ' FUNCTIONFILL(arg1function(parameter1,parameter2), arg2function(parameter2), arg3function(parameter3,parameter2))

    argxfunctions would return values based upon current parameter values that would be placed in the line while completing a function call usage.

    e.g. If 1st argument was image file type, and 2nd argument was a filename, then the 2nd argument popup to select a hard coded filename (something I never do by the way), would only select those files based upon the choice of the 1st argument such as JPG. Thus the context of the function fill would change based upon other fields currently set. These fill functions could be functions in the UDF or other UDF's so they could be shared

    In a similar fashion, a line like

    'FUNCTIONHELP SYS_SHELL_line

    might bring up a context help of the function which could be PDF file, CHM, DOC, HTML or whatever the defined line does explaining the use of the function in as much detail as the format allows. Probably would have to set a path somewhere or default to the current path.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  5. #5
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default

    Bill,

    I happened to check today, and Alpha still doesn't let you skip a parameter (ala function(a,,c) ). I'm bummed:(
    It shouldn't be that tough to implement IMHO,


    On the other hand, it does allow internal functions to work the same as external functions in terms of optional parameters. I'm not sure what version that this was incorporated, but I know having to specify all parameters for internal functions was a real pain.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  6. #6
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default

    That is good news about the internal functions. I have not checked that lately, and don't recall seeing it in build notes.

    Bill.

Similar Threads

  1. Parameter window too small
    By Ron Strougo in forum Alpha Five Version 6
    Replies: 0
    Last Post: 06-16-2005, 02:08 PM
  2. Function Parameter calling bug?
    By csda1 in forum Alpha Five Version 5
    Replies: 0
    Last Post: 07-29-2004, 10:48 AM
  3. Optional Dot-Variable Parameter
    By Blake in forum Alpha Five Version 5
    Replies: 2
    Last Post: 09-15-2003, 02:29 AM
  4. Prompting a Parameter run time!
    By Andy Dibble in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-24-2003, 07:03 AM
  5. Bad parameter?
    By Reese Fletcher in forum Alpha Five Version 4
    Replies: 2
    Last Post: 10-17-2001, 04:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •