Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visual Basic and VFP
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00873709
Message ID:
00873726
Views:
27
The activeX is from Bloomberg - http://about.bloomberg.com/software/index.html

It's used to acess stock ticker data from their web site. It only works correctly on a machine that is licensed to access their data.

For testing, since I generally can't interfere with client operations, and am not at their site, I have a simulater that fakes the internet hookup and generate fake data - so that's one more level of obfuscation or potential problems.

The VB code for what I need today [I will need other things later] simply passes a list of items to the activeX control

Dim vtResult As Variant
Dim vtFields As Variant
vtFields = Array("Last_Price", "Volume")
Dim vtSecurity As Variant
vtSecurity = Array("IBM US Equity", "CSCO US Equity")
dtStart = Date - 365
BlpData1.GetHistoricalData vtSecurity, 1, vtFields, dtStart, results:=vtResult

So it just calls and returns the values in the array - simple and easy to work with

When I try the equivlent in VFP, I need to supply another missing parameter after dtStart which is an end date, and two more arguments, to provide more info. By trial and error [no docs at all on VFP - just one example form] I ended up with

arraySecurity(1)= "IBM US Equity"
arrayFields(1)=1 <_--- for VFP this has to be numeric it seems, but at least I know what to use e.g. 1="Last_price"
thisform.oleBLP.GetHistoricalData(@arraySecurity,81,@arrayFields,DATE()-1,DATE(),30,'LAST_PRICE',@arrayResults)

Note that 81 is just an identifier I assign to identify the request

and can tell from the simulator, that it accepts this, but nothing appears to happen

If I instead I do [I discovered this by accident]
thisform.oleBLP.GetHistoricalData(@arraySecurity,81,@arrayFields,DATE()-1,DATE(),@arrayResults)
Then it returns with no values assigned to @arrayResults

But then, several seconds later, it executes a method in the ActiveX control, that method is passed an array with the results, it also receives the 81 value, so I know hoe to match up the results with the request but the call to that method occurs asychrously with regard to the request, and I think there is no guarantee the results appear in the same order as the requests where made, if for example I loop through multiple stocks.

Hope I managed to convey what's happening.
Previous
Reply
Map
View

Click here to load this message in the networking platform