[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-04 Thread PMario
Hi, For filters it may be possible to make them empty like: " " ... 1 space. A filter will return nothing, but it should be possible to detect the space if needed. -m -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this gro

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-04 Thread TonyM
Mario, Are you suggesting setting the default value for the first parameter to say "default" and when it is default do x and when it is not do y? In the case of it being used as a subfilter it will always return the default? I will test it. Thanks for the suggestion. Tony -- You received th

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-04 Thread PMario
Hi, If you need default values for parameters, you can define them. IMO that's the same as checking for empty values, which isn't possible atm. \define test(a:"aaa", b:"bbb") if a and b have default values -> do this test a -> do this test b -> do this \end have fun! mario -- You received t

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-04 Thread PMario
Hi, Be aware, that macro parameters are named! So this has to work: \define test(a, b) $a$ ... $b$ <> Calling macros with 1 or 2 parameters without names is lazy but ok. If they have more params it's extremely error prone. have fun! mario -- You received this message because you are subsc

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-04 Thread TonyM
Mohammad, Thanks for that. It is not dissimilar to the approach I found, however it would be good if we could reference all parameters passed, to the macro, if for no other reason to allow them all to be passed on to a subsequent macro without having to name them. Regards Tony -- You receive

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-03 Thread TonyM
I just realised the anseer, Name at least one parameter and test the first fow notempty. Will publish whenn compete. Good idea, when count of patameters is zero no parameter passed. Tony -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsub

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-03 Thread Mohammad
Further input: \define test(mylist) <$list filter="[enlist[$mylist$]]" emptyMessage="Empty"> <$view field="title"/> \end <> <> Results: a b Empty -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop recei

[tw5] Re: Testing if a macro has none, one or more parameters

2019-01-03 Thread Mohammad
Hi Tony, Not the answer to your question, but just a side note, Mark S has a small code to let you pass and determine the number of parameters passed. This is useful if you want to have a variable number of parameters. https://groups.google.com/d/msg/tiddlywiki/DXM3eiHHjw0/JbZ8dGFNCQAJ --Mohamm