Tony,
One question, how do you propose to implement the below construct using
$list widget
if a>b then
do this part one
else if a<b
do this part two
end
or only
if a< b then
do this true part
end
Now using match we can implement if a=b.
--Mohammad
On Thursday, August 1, 2019 at 3:46:23 AM UTC+4:30, TonyM wrote:
>
> Your welcome
>
> So on 5.1.20
> <$list filter="[<casevariable>] ~[[false]]" variable=case>
> <$list filter="[<case>match[false]]" variable=case>
> Do this if no case value
> </$list>
> <$list filter="[<case>match[caseone]]" variable=case>
> Process "caseone"<br>
> </$list>
> <$list filter="[<case>match[casetwo]]" variable=case>
> Process "casetwo"<br>
> </$list>
> <$list filter="[<case>match[casethree]]" variable=case>
> Process "casethree"<br>
>
> </$list>
> <!-- Even this -->
> <$list filter="[<case>match[casetwo]] [<case>match[casethree]]"
> variable=case>
> Process "casetwo" and "casethree"<br>
> </$list>
> </$list>
>
> Regards
> Tony
>
> On Thursday, August 1, 2019 at 3:34:59 AM UTC+10, Mohammad wrote:
>>
>> Thanks Tony!
>> This is great for code readability!
>>
>> Cheers
>> Mohammad
>>
>> On Wednesday, July 31, 2019 at 5:46:25 PM UTC+4:30, TonyM wrote:
>>>
>>> Folks,
>>>
>>> Ad a result of Jeremy adding a new match operator to 5.1.20 the case
>>> statements in this code pattern will be even more user friendly.
>>>
>>> First we would say
>>>
>>> [<case>prefix[caseone]suffix[caseone]]
>>>
>>> Now we would say
>>> [<case>regexp[^caseone$]]
>>>
>>> But this Will become which is easier to remember
>>> [<case>match[caseone]]
>>>
>>> The regex example still points us to the best approach for more complex
>>> tests but match will work for many common cases.
>>>
>>> I will now abandon only testing the negative in binary comparisons such
>>> as
>>> [<var>] -[[false]]
>>>
>>> becomes
>>> [<var>match[true]]
>>>
>>> the case insensitive option may also help when var or
>>> [{$:/temp/tiddler}] was provided by the user in case they entered tRue and
>>> other combinations by mistake.
>>>
>>> Thanks Jeremy
>>> Tony
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/886c14b0-6519-42e7-91d8-c46c8554d2ea%40googlegroups.com.