by Colin Haig » Tue Sep 29, 2009 12:58 pm
static function Convert(oPo)
Local oSoap := Mcs_OleObj("MSSOAP.SoapClient30")
Local nRate := nil,nAmount := 0,cTo := 'AUD',cCurr := '',nCurrRate := 0,lCont := TRUE
nCurrRate := oPo:rate()
if nCurrRate <> 0
if ! MsgNoYes('Changing Rate - Are You Sure ?')
lCont := FALSE
endif
endif
if lCont
nAmount := oPo:us
cCurr := oPo:curr
CursorWait()
oSoap:MsSoapInit("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")
oSoap:ClientProperty("ServerHTTPRequest")
nRate := oSoap:ConversionRate(substr(cCurr,1,3),substr(cTo,1,3))
oSoap := nil
nAmount := nAmount * nRate
oPo:aud := nAmount
oPo:rate := nRate
oPo:save()
SndPlaySound("Ding",1)
CursorArrow()
endif
Return nil
//--------------------------------------------------------------------------------------------------------//
Please note the code relating to SOAP came from Byron - form Matrix Software ( from memory)