$PBExportHeader$f_get_col.srf
global type f_get_col from function_object
end type

forward prototypes
global subroutine f_get_col (datawindow as_dw, ref string col_list[])
end prototypes

global subroutine f_get_col (datawindow as_dw, ref string col_list[]);/*
	Column grabber
	By : Aristedes O Extra (aoextra@yahoo.com)
	
	Some of you probably knows this already, but I thought I'd share it those dont yet.
	
	e.g. on how to call this function
	on your window put the following
	
		String ls_cols[]
		f_get_col(dw_1,a)
		
	ls_cols should now contain all the columns in dw_1	


	
*/

string	ls_ObjString, ls_ObjHolder,ls_ObjList[]
integer	li_Start=1, li_Tab, li_Count=0,li_index

ls_ObjString = as_dw.Describe("Datawindow.Objects")
li_Tab =  Pos(ls_ObjString, "~t", li_Start)

Do While li_Tab > 0
	ls_ObjHolder = Mid(ls_ObjString, li_Start, (li_Tab - li_Start))
	li_Count ++
	If right(ls_Objholder,2) <> "_t" And left(ls_ObjHolder,4) <>  "obj_" Then
		li_index++
		ls_ObjList[li_index] = ls_ObjHolder
	End If			
	li_Start = li_Tab + 1
	li_Tab =  Pos(ls_ObjString, "~t", li_Start)
Loop 
col_list = ls_ObjList



end subroutine