Hi Eric,
You are amazing!
Yep, that's the solution using limit[] or first[] operators.
I did the solution by storing the padded number in a list field of a
tiddler and then using enlist.
See
here: file:///G:/TW/TW-Scripts/Scripts%20in%20TW%205.1.20-pre.html#100.50
But your solution is much superior. You did the magic!
*Thank you INDEED!*
-- Mohammad
On Friday, February 15, 2019 at 10:31:43 PM UTC+3:30, Eric Shulman wrote:
>
> On Friday, February 15, 2019 at 9:36:26 AM UTC-8, Mohammad wrote:
>>
>> But we do not know in advance what is the number, and it is given by
>> user!
>> So if n is a variable, then how we can generate these numbers?
>>
>>>
> If we DID know the number in advance, we could just use it in the operand
> of the range[...]
>
> For example, suppose the desired number is, say, 256. Then we could just
> modify the filter be:
> [range[9]addprefix[00]] [range[10,99]addprefix[0]] [range[100,256]]
>
> However, since you want the number to be "given by user", we need to use a
> different approach. Instead of hard-coding the number, we can use the
> limit[...] filter. Let's suppose the desired number is in variable called
> "max". Then we could write:
> [range[9]addprefix[00]] [range[10,99]addprefix[0]] [range[100,999] +[limit
> <max>]
>
> and if the desired number is in a tiddler (e.g. $:/temp/input/userlimit,
> as a result of user input), we could write:
> [range[9]addprefix[00]] [range[10,99]addprefix[0]] [range[100,999] +[limit
> {$:/temp/input/userlimit}]
>
> -e
>
> note: edited to fix missing syntax in last two examples.
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/f7eb238e-f966-43a6-8231-d5d5ce3d4b03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.