WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Convert Data Returned OLE


;Convert Data Returned OLE

#DefineSubroutine ConvertOLEData( element )
	newelement = StrCat("",element)
	If StrSub(newelement,1,1)=="#" Then element = StrSub(newelement,StrIndex(newelement,":",0,@FWDSCAN)+1,-1)
	If StrLen(StrClean( newelement, ":", "", @FALSE, 2)) == 5  ;thanks to Deana for this snippet
	   xyear  = ItemExtract(1,newelement,":")
	   xmonth = Int(ItemExtract(2,newelement,":"))
	   xday   = ItemExtract(3,newelement,":")
	   xhour  = ItemExtract(4,newelement,":")
	   xmin   = ItemExtract(5,newelement,":")
	   xsec   = ItemExtract(6,newelement,":")   
	   AMPM   = "AM"
	   If xhour >= 13
	      xhour = xhour-12
	      AMPM = "PM"
	   Endif   
	   element=strcat(xmonth,"/",xday,"/",xyear," ",xhour,":",xmin,":",xSec," ",AMPM)
	Endif
	Return( element )
#EndSubRoutine

;Sample OLE Data in an Array.
myarr = arrdimension(3)
myarr[0] = "2004:04:19:00:00:00"	;DATE
myarr[1] = "#DECIMAL:1.2345"		;DECIMAL
myarr[2] = "#CURRENCY:1.23"		;CURRENCY

For i = 0 to ArrInfo(myarr,6)-1
	 element = ConvertOLEData(myarr[i])
	 Message("element",element)
Next

Article ID:   W16065
File Created: 2004:03:30:15:42:42
Last Updated: 2004:03:30:15:42:42