How to extract number of y-waves only on top graph?

Hi,

I have written a function that manipulates the y-waves on the top graph and it requires the number of y-waves on the top graph. I have been using:

GetWindow kwTopWin, wavelist 	
Wave W_WaveList		
Variable j = DimSize(W_WaveList, 0)

and I run a loop for 'j' number of times. Anyway, the issue I've run into is that the code above defines 'j' with the x-waves and y-waves included. Is there anyway to manipulate the code I have to define 'j' with respect to just the y-waves?

Thanks!

I don't quite understand what you want to do but maybe you need "TraceNameList".

Probably not related, but your code above should read: 

Wave/T W_WaveList	

 

In reply to by ChrLie

Effectively, I want to define a variable with the number of y-waves on the top graph. The issue is the function 'wavelist' generates the text wave 'W_WaveList' with all the waves on the top graph, including the x-waves. This is causing the variable, 'j' as I've defined it, to be much too large, depending on the number of x-waves used to plot. I effectively am asking if there is a way to manipulate wavelist or another function entirely that I can use to get the number of y-waves only on a window.

TraceNameList(graphNameStr, separatorStr, optionsFlag )

returns just the y waves. It returns list, so one needs to set j=itemsInList and select proper optionsFlag (my guess is 1 is suitable). Two lines of code :

        TraceNames=TraceNameList(kwTopWin,";",1)
        j =  ItemsInList(TraceNames)

Actually, it can be single line:

                j =  ItemsInList(TraceNameList(kwTopWin,";",1))