Hello,
It is pretty simple. CategoryGetName will return empty string if you pass the
last one:
WLs = "";
i = 0;
while( ( wlname = CategoryGetName( categoryWatchlist, i++ ) ) != "" )
{
if( InWatchList( i ) )
{
WLs = WLs + wlname + "\n";
}
}
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Lester Vanhoff" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, April 20, 2007 11:43 PM
Subject: [amibroker] How To Display Watch List Names In v4.92
> I've been using the following code to display watch list names of all watch
> lists to which a selected ticker belongs. Before, when
> the maximum number of watch lists was 64 the "for" loop looked like this:
>
> for( i = 0; i < 64; i++ )
>
> What's the best way to find the number of the last watch list in v4.92, where
> the number of watch lists is unlimited?
>
> For now, I setup watch list named "ztmp" as the last one and first run:
>
> wlnum = CategoryFind("ztmp", categoryWatchlist );
>
> to find its number, but this is not a very neat solution.
>
> // Display Watch List names
>
> // Find watch list number by WL name (returns WL number).
> // WL "ztmp" must always be the last WL in Index.txt.
>
> wlnum = CategoryFind("ztmp", categoryWatchlist );
>
> // the remaining code
>
> WLs = "";
>
> for( i = 0; i < wlnum; i++ )
> {
> if( InWatchList( i ) )
> {
> WLs = WLs + CategoryGetName( categoryWatchlist, i ) + "\n";
> }
> }
>
> Title = "\\c11" + WLs + wlnum;
>
> /*** END ***/
>
>
>
>
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
>