Wish I would like to have Optional Parameters for Subs - Widget    Jul 14, 2016   (9 reactions) In Delphi procedures you can have default values for parameters. That means these parameters are optional. If the sub is called without these parameters, the default values will be used instead.
Why would you need this?
It allows for the creation of more flexible & intelligent Subs. Default paramet Wish "Default Parameter Value" of a SUB - Sandman (first post)    Oct 17, 2022   (1 reaction) Now there, I don't think anyone here tried promoting "hiding parameters". That seems a bit unfair to label it as such.
It seems to me that your argument could be rephrased to "I don't like default parameters because they won't show up in the sub signature". To me, that indicates that you perhaps ha Wish optional argument and default values - Sepehr_b (first post)    Oct 08, 2023   (1 reaction) I do agree with the optional parameters with default values
hope for the next versions Wish Another plea for optional parameters - NeoTechni    Aug 18, 2017   (3 reactions) Since my program is so large, it's getting increasingly difficult to add parameters to functions, cause I don't want to have to go through all the existing code to add default parameter values. I've been using messy/bad coding habits to get around this, by using a single parameter for multiple thin Wish Optional Parameters - LWGShane    Mar 26, 2017   (3 reactions) Has there been any updates regarding Optional Parameters for B4X? It would be a very useful feature! Wish optional parameters with default - NeoTechni (first post)    Mar 02, 2015   (1 reaction) I'd like to suggest how this could be implemented.
I'm pretty sure you have some code that enumerates the parameters for a given function and stores it in a variable type like:
type Parameter(Name as string, pType as string, isArray as boolean)
which gets put in a list
Add 2 members, 1 named Defaul Wish Option for All Events to Show in Log? - mmieher (first post)    Jul 24, 2022 Looks good. Optionally logging something about each parameter would be cool too. Wish Unlimited number of arguments when using CallSub/CallSubDelayed - LucaMs (first post)    Jul 07, 2019 Thanks but, even if I agree, optional parameters are useful (sometimes), I refer to the possibility of using CallSub and CallSubDelayed with an unlimited number of arguments, which is not the same thing.
I think that this thread could be considered closed ;) Wish Optional Parameters - clean up the sub, sub1, sub2 mess - rondunn (first post)    Dec 03, 2015 Not quite. That isn't an optional parameter, it is a parameter with a magic value.
Someone reading the code has to think "What is -1? Is it a real value?" when they read that function.
In my case I've got quite a few functions with 4-6 mandatory parameters, and maybe two optional parameters. Those Wish CallSub - free number of parameters - LucaMs    Jan 23, 2019   (2 reactions) Currently you can pass a maximum of two parameters, using CallSub3 (or CallSubDelayed3).
The ideal would be that you could pass any number of parameters (also that you could declare them as optional in the routine signature, but this is another question).
I know, I can pass a data structure (Array, Page: 1   2   3   4   5   6   7   Powered by ColBERT |