FUNCTION sqlServerList2HostArr, headPtr
;;-----------------------------------------------------------------------------
;; PURPOSE:
;;	Converts a list of sqlServers to an array of host names. If the head
;;	is a null pointer, the output is undefined.
;;
;; CALLING SEQUENCE:
;;	arr = sqlServerList2HostArr(headPtr)
;;
;; REQUIRED INPUTS:
;;	pointer to the head of the list
;;
;; OUTPUTS:
;;	string array of the host names
;;		
;; OPTIONAL INPUT KEYWORDS:
;;
;; EXAMPLE:
;;      IDL> arr = sqlServerList2HostArr(headPtr)
;;
;; PROCEDURES USED (i.e. called directly!):
;;
;; MODIFICATION HISTORY:
;;   	2004-09-27  M. Desnoyer - Created
;;
;;-----------------------------------------------------------------------------

IF NOT ptr_valid(headPtr) THEN RETURN, ''

hosts = ''
cur = headPtr
WHILE ptr_valid(cur) DO BEGIN
	hosts=[hosts,(*cur).host]
	cur = (*cur).next
ENDWHILE
RETURN, hosts[1:*]

END