Message: 11
From: "vinuth madinur" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Thu, 15 Apr 2004 11:40:27 +0800
Subject: [NTG-context] Re: help required w.r.t " vardef "
Reply-To: [EMAIL PROTECTED]

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


_______________________________________________ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to