[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: JScript help please.



PureBytes Links

Trading Reference Links

Dingo,

That's it.  I felt stupid for not checking the code closely.  Thanks 
very much.


--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> So which line is line 88?
> 
>  
> 
> you don't have a "." in the literal "DAT" --> ".DAT"  
> 
>  
> 
> d
> 
>  
> 
> -----Original Message-----
> From: mmqp [mailto:mmqp@x...] 
> Sent: Friday, March 14, 2003 6:42 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] JScript help please.
> 
>  
> 
> Hi,
> 
> I am trying to write a Jscript which will take the ticker from AFL; 
> build the dataFile name from this variable inside script; open the 
> file and read ins datas inside the file; It then returns datas from 
> the file back into AFL variables.  However I got the Jscript errors 
> 
> Source: Microsoft JScript runtime error
> Line:   88   Char:   1
> Error:  0  -   File not found.
> 
> Can someone see if I have declared the file object correctly?
> 
> Here is the code.  TIA
> 
> 
> currentTicker = Name();
> 
> <%
> var ForReading = 1,ForWriting = 2, ForAppending = 8;
> var fileSystemObj, tickerString, currentLine;
> var wmp30Dir, currentFileName;
> 
> tickerString = AFL("currentTicker"); // GetArray ("Price") from AFL
> 
> winMidasDir = "C:\\wmp30\\";
> fileSystemObj = new ActiveXObject("Scripting.FileSystemObject"); // 
> creating an object type ActiveX
> dataFilePtr = fileSystemObj.OpenTextFile (winMidasDir + 
tickerString 
> + "DAT", ForReading); // build datafile name
> 
> for ( i = 0; i < 11; i++ ) {
>   currentLine = dataFilePtr.ReadLine();
>   switch ( i ) {
>     case 0:
>       startOfBars = currentLine;
>     case 1:
>       S1LaunchDate = currentLine;
>     case 2:
>             S2LaunchDate = currentLine;
>     case 3:
>             S3LaunchDate = currentLine;
>     case 4:
>             R5LaunchDate = currentLine;
>     case 5:
>             R4LaunchDate = currentLine;
>     case 6:
>             R3LaunchDate = currentLine;
>     case 7:
>       R2LaunchDate = currentLine;
>     case 8:
>       R1LaunchDate = currentLine;
>     case 9:
>             TBLaunchDate = currentLine;
>     case 10:
>       TBCenterDate = currentLine;
>     default:
>       ;
>   } // end of switch.
> }
> 
> dataFilePtr.Close();
> 
> AFL.Var("S1LaunchDate") = S1LaunchDate;
> AFL.Var("S2LaunchDate") = S2LaunchDate;
> AFL.Var("S3LaunchDate") = S3LaunchDate;
> AFL.Var("R5LaunchDate") = R5LaunchDate;
> AFL.Var("R4LaunchDate") = R4LaunchDate;
> AFL.Var("R3LaunchDate") = R3LaunchDate;
> AFL.Var("R2LaunchDate") = R2LaunchDate;
> AFL.Var("R1LaunchDate") = R1LaunchDate;
> AFL.Var("TBLaunchDate") = TBLaunchDate;
> AFL.Var("TBCenterDate") = TBCenterDate;
> 
> %>
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> 
> 
> 
> ADVERTISEMENT
>  
> 
<http://rd.yahoo.com/M=243066.2784921.4151384.1927555/D=egroupweb/S=17
05
> 632198:HM/A=1377501/R=0/*http:/www.verisign.com/cgi-bin/go.cgi?
a=b308901
> 13200616000> 
> 
> 
>  
> <http://us.adserver.yahoo.com/l?
M=243066.2784921.4151384.1927555/D=egrou
> pmail/S=:HM/A=1377501/rand=706426858> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to the Yahoo!
> <http://docs.yahoo.com/info/terms/>  Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/