[tw] Re: Generating a list based on custom fields.

2009-11-23 Thread Jakob Graulund Jørgensen
startsWith is a string function added by FET to the string prototype.
You can't perform on an array, which is what readBracketedList()
returns. So, do you have to do a readBracketedList to begin with?

Obviously the simpler thing always works perfectly:

forEachTiddler
  where
'store.getValue(tiddler,fieldone)   store.getValue
(tiddler,fieldone).startsWith([A])  '

write

 '   tiddler FakeLink with: [[+tiddler.title+]] \ \n ' 

Thx you for the help

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-21 Thread Tobias Beer
How about some good old...

indexOf('A')==0

?

Tobias.

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-21 Thread Tobias Beer
Sorry, didn't pay attention.

startsWith is a string function added by FET to the string prototype.
You can't perform on an array, which is what readBracketedList()
returns. So, do you have to do a readBracketedList to begin with?

What about...
store.getValue(tiddler,fieldone).startsWith([A])

Or simply...
store.getValue(tiddler,fieldone).indexOf(A)==0

Tobias.

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-19 Thread Måns
Maybe even: sortBy 'tiddler.fields[fieldone].toUpperCase()'
Don't know if it's written in the right place... But I know it works
with this:
sortBy 'tiddler.title.toUpperCase()'

Regards Måns Mårtensson

On 19 Nov., 17:38, Måns humam...@gmail.com wrote:
 sortBy 'tiddler.fields[fieldone]' ??

 forEachTiddler
 where
     ' store.getValue(tiddler,fieldone) 
       store.getValue(tiddler,fieldone).readBracketedList().contains
 ([A]) '
 sortBy 'tiddler.fields[fieldone]'

 Måns

 On 19 Nov., 17:12, Jakob Graulund Jørgensen jakobgraul...@gmail.com
 wrote:



  Hi

  I'm trying to create a couple of alphabetazied lists (ei. a-m, n-t, u-
  z) . The lists have to be alpabetazied according to tiddlers' custom
  fields, and I want the costum fields to be what is displayed in the
  list (ie. not the title as usually).

  I cant however quite make it work.

  My guess is something like

  forEachTiddler
    where
      ' store.getValue(tiddler,fieldone) 
        store.getValue(tiddler,fieldone).readBracketedList().startsWith
  ([A]) '

  write
   '  tiddler FakeLink with: +tiddler.title+ \ \n '

  And then creating a tiddler called [[FakeLink]], containing:
  --
  /%
  !out
  [[$1|$2]]
  !end
  %/tiddler FakeLink##out with:
     {{store.getValue('$1','fieldone')}} [[$1]]
  --

  This only works with

    where
      ' store.getValue(tiddler,fieldone) 
        store.getValue(tiddler,fieldone).readBracketedList().contains
  ([A]) '

  which result in a less than alphabetized list.

  hope the make sense and that somebody can help me

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-19 Thread Jakob Graulund Jørgensen
 sortBy 'tiddler.fields[fieldone]' ??

it is
store.getValue(tiddler,fieldone).readBracketedList().contains
that is the problem. It doesnt distinguish between for example
aaaBccc and cccBaaa

Which is why i want to use .startsWith but i cant make that work


--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-19 Thread Måns
sortBy 'tiddler.fields[fieldone]' ??

forEachTiddler
where
' store.getValue(tiddler,fieldone) 
  store.getValue(tiddler,fieldone).readBracketedList().contains
([A]) '
sortBy 'tiddler.fields[fieldone]'

Måns

On 19 Nov., 17:12, Jakob Graulund Jørgensen jakobgraul...@gmail.com
wrote:
 Hi

 I'm trying to create a couple of alphabetazied lists (ei. a-m, n-t, u-
 z) . The lists have to be alpabetazied according to tiddlers' custom
 fields, and I want the costum fields to be what is displayed in the
 list (ie. not the title as usually).

 I cant however quite make it work.

 My guess is something like

 forEachTiddler
   where
     ' store.getValue(tiddler,fieldone) 
       store.getValue(tiddler,fieldone).readBracketedList().startsWith
 ([A]) '

 write
  '  tiddler FakeLink with: +tiddler.title+ \ \n '



 And then creating a tiddler called [[FakeLink]], containing:
 --
 /%
 !out
 [[$1|$2]]
 !end
 %/tiddler FakeLink##out with:
    {{store.getValue('$1','fieldone')}} [[$1]]
 --

 This only works with

   where
     ' store.getValue(tiddler,fieldone) 
       store.getValue(tiddler,fieldone).readBracketedList().contains
 ([A]) '

 which result in a less than alphabetized list.

 hope the make sense and that somebody can help me

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-19 Thread Måns
I found this: http://tinyurl.com/yzpw5k7

Maybe it's the where
 'tiddler.title.startsWith(Site)'

Which you could change to sth usable
where
 'tiddler.fields[fieldone].startsWith(A)'

???

regards Måns Mårtensson

On 19 Nov., 17:53, Jakob Graulund Jørgensen jakobgraul...@gmail.com
wrote:
  sortBy 'tiddler.fields[fieldone]' ??

 it is
 store.getValue(tiddler,fieldone).readBracketedList().contains
 that is the problem. It doesnt distinguish between for example
 aaaBccc and cccBaaa

 Which is why i want to use .startsWith but i cant make that work

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.




[tw] Re: Generating a list based on custom fields.

2009-11-19 Thread Jakob Graulund Jørgensen
  'tiddler.fields[fieldone].startsWith(A)'

it is a good idea but I simply cant get the .startswith to work. same
problem as my original.

--

You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.