From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15020 Path: main.gmane.org!not-for-mail From: Jonathan Nicholl Newsgroups: gmane.comp.tex.context Subject: Re: request for help with suffix arrays Date: Thu, 15 Apr 2004 19:09:15 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <01724624-8F08-11D8-A929-000A956A3A8A@kcl.ac.uk> References: <20040415100008.26015.9137.Mailman@ref.ntg.nl> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1082052839 29304 80.91.224.253 (15 Apr 2004 18:13:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2004 18:13:59 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Thu Apr 15 20:13:49 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BEBMz-0004co-00 for ; Thu, 15 Apr 2004 20:13:49 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 8AE7010B52; Thu, 15 Apr 2004 20:10:18 +0200 (MEST) Original-Received: from outbound.kcl.ac.uk (elder.kcl.ac.uk [137.73.2.27]) by ref.ntg.nl (Postfix) with ESMTP id 914B610B51 for ; Thu, 15 Apr 2004 20:08:25 +0200 (MEST) Original-Received: from [137.73.2.10] (helo=redwood.kcl.ac.uk) by outbound.kcl.ac.uk outbound with esmtp id 1BEBL6-0004an-UG for ntg-context@ntg.nl; Thu, 15 Apr 2004 19:11:52 +0100 Original-Received: from [80.189.171.69] (gr.189.171.69.dial.global.net.uk [80.189.171.69]) by redwood.kcl.ac.uk with SMTP id i3FI9aC4021246 for ; Thu, 15 Apr 2004 19:09:37 +0100 (BST) In-Reply-To: <20040415100008.26015.9137.Mailman@ref.ntg.nl> Original-To: ntg-context@ntg.nl X-Mailer: Apple Mail (2.613) X-KCL-MailScanner: Found to be CLEAN X-MailScanner-From: jonathan.nicholl@kcl.ac.uk Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:15020 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15020 > Message: 11 > From: "vinuth madinur" > 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