ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jonathan Nicholl <jonathan.nicholl@kcl.ac.uk>
Subject: Re: request for help with suffix arrays
Date: Thu, 15 Apr 2004 19:09:15 +0100	[thread overview]
Message-ID: <01724624-8F08-11D8-A929-000A956A3A8A@kcl.ac.uk> (raw)
In-Reply-To: <20040415100008.26015.9137.Mailman@ref.ntg.nl>

> Message: 11
> From: "vinuth madinur" <vinlin@linuxmail.org>
> To: ntg-context@ntg.nl
> Date: Thu, 15 Apr 2004 11:40:27 +0800
> Subject: [NTG-context] Re: help required w.r.t " vardef "
> Reply-To: ntg-context@ntg.nl
>
> Thanks Hans!
>               That wolud help me a lot.Also thanks for the reference u 
> mentioned.I'll try it.
>
> Now one last thing :
>
>  Is there a way of having variable arrays whose contents can be used 
> as "suffixes"?
>
>  something like ,
>
> a[0]:= "A" ;
> a[1]:= "B" ;
> a[2]:= "C" ;   %a variable array "a[]"
>
>
> there are other three "pair" variables : T.A,T.B,T.C;
>
> so now I want to have ,
>
> i := 0;
> T.a[i] = blahblah();
>
> so here I want to use the contents of "a[]" as suffix of variable " T 
> " .
>
> I don't know what kind of data type to use for "a[]".
> I tried a[] as string type and used it with
>
>  forsuffixes $=a[0],a[1],a[2]:
>    .....
>  endfor;
> but this does not work.
>
> So, can u please help me out here?
> thanx in advance.
>
> Vinuth.
> -- 
> ______________________________________________
> Check out the latest SMS services @ http://www.linuxmail.org
> This allows you to send and receive SMS through your mailbox.
>
>
> Powered by Outblaze

You could use 'scantokens':

	string a[];

	a 1 := "A";
	a 2 := "B";
	a 3 := "C";

	T A := 11;
	T B := 12;
	T C := 13;

	for i = 1 upto 3:
		show (T scantokens a [i]);
	endfor;

	end

This produces the output

	>>11
	>>12
	>>13

The idea is to store the suffixes as strings, and then use 'scantokens' 
to extract them.

Best wishes,

Jonathan

-----------------------

Jonathan Nicholl
Department of Philosophy
King's College London

           reply	other threads:[~2004-04-15 18:09 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20040415100008.26015.9137.Mailman@ref.ntg.nl>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01724624-8F08-11D8-A929-000A956A3A8A@kcl.ac.uk \
    --to=jonathan.nicholl@kcl.ac.uk \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).