ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* getting characters
@ 2006-01-25  9:42 Hans van der Meer
  2006-01-25 10:00 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Hans van der Meer @ 2006-01-25  9:42 UTC (permalink / raw)


While fiddling with character strings I found the \getfirstcharacter  
macro which is very handy.
However, I am consuming a character string character by character.
Although I have a macro for that, I think it is a good policy to stay  
as much as possible within the ConTexT framework when concocting  
macro's to be used under ConTeXt.

Now for the question.
  \getfirstcharacter puts the first character in \firstcharacter.
I looked for a macro containing the rest of the string but could not  
find one.
Something like:
	\getfirstcharacter{abc}
then
	\firstcharacter = a
	\lastcharacters = bc

This will make it possible to process a string character by  
character, in the same way as \processcommalist does with comma  
separated strings.
But possibly this is already somewhere in the code and I overlooked it.

yours sincerely,
dr. H. van der Meer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting characters
  2006-01-25  9:42 getting characters Hans van der Meer
@ 2006-01-25 10:00 ` Taco Hoekwater
  2006-01-25 10:43   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2006-01-25 10:00 UTC (permalink / raw)



Hi Hans,

I do not think it is available already, but it is very
simple to patch the \getfirstcharacter macro:

   \def\dogetfirstcharacter#1#2\\%
     {\def\firstcharacter{#1}\def\remainingcharacters{#2}}

(I like 'remaining' better than 'last')

Cheers, taco

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting characters
  2006-01-25 10:00 ` Taco Hoekwater
@ 2006-01-25 10:43   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2006-01-25 10:43 UTC (permalink / raw)


Taco Hoekwater wrote:

>Hi Hans,
>
>I do not think it is available already, but it is very
>simple to patch the \getfirstcharacter macro:
>
>   \def\dogetfirstcharacter#1#2\\%
>     {\def\firstcharacter{#1}\def\remainingcharacters{#2}}
>
>(I like 'remaining' better than 'last')
>  
>
ok, patched 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-25 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-25  9:42 getting characters Hans van der Meer
2006-01-25 10:00 ` Taco Hoekwater
2006-01-25 10:43   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).