If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Live exchange rates

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-03, 18:49
alski alski is offline
Registered User
 
Join Date: Dec 2002
Posts: 24
Live exchange rates

Hi,

I have three problems essentially based around the same issue.

I have a webpage on my website which makes a call to a webpage on my merchant bank's website which retrieves the latest exchange rates for several currencies.

The textual information comes back as:

#Exchange rates for installation 99999
#Fri Aug 01 22:13:22 GMT 2003
GBP_USD=1.6392034337924026
GBP_CAD=2.281670710345653
rateDateString=2003-08-01
allRatesCurrent=true
rateDateMillis=1059696000000
GBP_AUD=2.470938422406323
GBP_GBP=1.0
GBP_EUR=1.4320527991077803



I then have another page that has to use these currency rates to convert a fixed sum of money in pound sterling, say £80, and return a value in the other currencies.

i.e., using the figures above, where GBP_USD = 1.6392034337924026

the page needs to return a value of $131.14

I am using Active Server Pages.

......query continued in next message........
Reply With Quote
  #2 (permalink)  
Old 08-01-03, 18:52
alski alski is offline
Registered User
 
Join Date: Dec 2002
Posts: 24
cont. message

...........continued message............
The first question is: using ASP, can I make a call to my merchant bank's website just once a day, instead of making a call to it every time the page is opened or refreshed?

Second question: How do I extract just the e.g. US$ value from the textual information I get from the bank above? - I need to parse it in some way but I don't know how.

Third question: Using that parsed information, how do I then get the value of the exchange rate into a variable, which I can then go on to use?

For example, what I tried was to place the figure of "1.6392034337924026" in an ASP file (remove all html and just have that 1.6392034337924026 figure) and name the file "ExchangeRateUSD.asp". In another page I tried retrieving that exchange rate figure and placing it in a variable by writing:

.......continued message.........
Reply With Quote
  #3 (permalink)  
Old 08-01-03, 18:53
alski alski is offline
Registered User
 
Join Date: Dec 2002
Posts: 24
cont.message

...cont message.........

[ code ]
<% Dim strExchangeRate, strExchangeRateUSD
strExchangeRate = 1
strExchangeRateUSD = <!--#include file="ExchangeRateUSD.asp" -->%>
<% strExchangeRate = strExchangeRateUSD%>
[ / code ]

which my PC really didn't like!

If I can place the exchange rate I get from my bank into a variable, I will be able to work with it

Cheers
Alski
(sorry message was so long!!)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On