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

Re: [amibroker] Function / VBScript



PureBytes Links

Trading Reference Links

and another, more extended example:

EnableScript("jscript");

<%
function WriteThisToFile ( arg ) {
   var objFSO  = new ActiveXObject("Scripting.FileSystemObject");
   var intFile = objFSO.OpenTextFile("fTrial.txt", 8, 1);
       intFile.WriteLine( arg );
       intFile.Close();
}
%>

function fTrial() {
   local arrAFL;
<%
   function GetArray( Name ) { return VBArray( AFL( Name ) ).toArray(); }
   var arrJS = GetArray("Close");
   AFL.Var("arrAFL") = arrJS;

   var objFSO  = new ActiveXObject("Scripting.FileSystemObject");
   var intFile = objFSO.OpenTextFile("fTrial.txt", 2, 1);
       intFile.WriteLine("$SEPARATOR ,");
       intFile.WriteLine("$FORMAT");
       intFile.WriteLine(arrJS[0] + " " + arrJS[1]);
       intFile.Close();
   WriteThisToFile("blabla");
%>
   return arrAFL;
}

Plot(1.09*fTrial(), "", colorRed);

objScript = GetScriptObject();
objScript.WriteThisToFile("blabla2");


cheers,
BM


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/