[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Multi-dimension arrays?



PureBytes Links

Trading Reference Links

from a post by tomasz
As to your question:
> so tell us how we access via tablename one element of our table ...

This is very easy ...
Desired access to tablename[x][y] can be implemented as follows
using VarSet / VarGet (note that this is only ONE OF MANY possible ways)

function Set2DimTable( tablename, x, y, value )
{
 VarSet( tablename + StrFormat("%05.0f%05.0f", x, y ), value );
}

function Get2DimTable( tablename, x, y )
{
 return VarGet( tablename + StrFormat("%05.0f%05.0f", x, y ) );
}


Example use:

Set2DimTable( "blabla", 2, 3, High[ 0 ] );

This actually shows how VarSet/VarGet can be used to implement
"equivalent of doubly dimensioned arrays i.e. tables in pure AFL".


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 17/06/06, dingo <dingo@xxxxxxxxxxxx> wrote:
> Not using AFL.   But you can do it via the Osaka Plug In.
> http://finance.groups.yahoo.com/group/amibroker-dll/files/
>
> Or you can really get gnarly and use dynamic variables..
>
> d
>
> > -----Original Message-----
> > From: amibroker@xxxxxxxxxxxxxxx
> > [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of PKJR
> > Sent: Friday, June 16, 2006 8:58 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Multi-dimension arrays?
> >
> > Hi All:
> >
> > Can I use multi-dimension arrays? like A[m, n] in AmiBroker?
> >
> > example: I want to read a data from a text file for a series
> > of ticker names and each ticker will have some additional settings:
> > XYZ, v11, v12, v13
> > ABC, v21, v222, v23
> >
> > I want to store this info in an array and re-use this in AFL
> > code..is this possible?
> >
> > Paul
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > --------------------~--> Check out the new improvements in
> > Yahoo! Groups email.
> > http://us.click.yahoo.com/DEOZVC/fOaOAA/cosFAA/GHeqlB/TM
> > --------------------------------------------------------------
> > ------~->
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly
> > to SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>