;; 
;;=====================================================================================----- 
;; 
;;FUNCTION       DispResult() 
;; 
;;ACTION         Displays any type of data 
;; 
;;AUTHOR         Glenn Barnas 
;; 
;;VERSION        1.0 - 2018/06/01 
;; 
;;HISTORY        1.0 - 2018/06/01 - Initial Release 
;; 
;;SYNTAX         DispResult(Data) 
;; 
;;PARAMETERS     Data - REQUIRED - Data to display 
;; 
;;REMARKS        Displays the data provided, regardless of type. Useful for 
;;               development tasks where many types of data must be verified. 
;; 
;;RETURNS        Nothing - outputs the supplied data 
;; 
;;DEPENDENCIES   none 
;; 
;;TESTED WITH    W2K8, W2K12, W2K16 
;; 
;;EXAMPLES       $aData = 1,3,23 
;;               DispResult($aData) 
; 
Function DispResult($_Data)
 
  Dim $_Type, $_X
 
  $_Type = 0
 
  If VarType($_Data) = 8
    $_Type = 1
  EndIf
 
  If VarType($_Data) > 8192
    If UBound($_Data, 2) >= 0
      $_Type = 3
    Else
      $_Type = 2
    EndIf  
  EndIf
 
 
  Select
   Case $_Type = 0
    'Invalid Data!' @CRLF
 
   Case $_Type = 1
    'ITEM: ' $_Data @CRLF
 
   Case $_Type = 2
    'ARRAY: ' 1 + UBound($_Data) ' records returned.' @CRLF
    For $_X = 0 to UBound($_Data)
      $_X '.	' $_Data[$_X] @CRLF
    Next
 
   Case $_Type = 3
    '2D-ARRAY: ' 1 + UBound($_Data, 2) ' records returned.' @CRLF
    For $_X = 0 to UBound($_Data, 2)
      $_Data[0, $_X] ' : ' $_Data[1, $_X] @CRLF
    Next
 
  EndSelect
 
  @CRLF
 
  Exit 0
 
EndFunction