Lol , I have tried the 4th issue of Amibroker Tips newsletter and I meet a problem
4 Tip of the week: : How to automate assigning stocks to sectors/industries ? http://www.amibroker.com/newsletter/04-2000.html The solution uses the javascriptlangage . I have done the same trick but in vbscript and I meet a bug [CODE]AmiBroker.Stocks.Add(fields(0)) ` the bug is here [\CODE] Here is my vbscript solution [CODE] Dim fso, f, r Dim fields Const ForReading = 1 dim AmiBroker 'dim stock Set AmiBroker = CreateObject("Broker.Application") Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("C:\Documents and Settings\antunes\Mes documents\TEST1.txt", ForReading) 'msgbox pourvoir 'wscript.echo cstr(pourvoir) do While f.AtEndOfStream <> true r = f.ReadLine() 'wscript.echo r fields = Split(r,",") AmiBroker.Stocks.Add(fields(0)) ` the bug is here .How to write this line ? How to see the variable's type fields ?Cstr function to convert to string variable ? `AmiBroker.Stocks.Add("ADB") 'pas trop mal mais pas encore ça 'stock.FullName = fields( 1 ) 'stock.IndustryID = CInt( fields( 2 ) ) on error resume next loop AmiBroker.RefreshAll() [/CODE]
