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

[amibroker] mixing AFL+JS: help needed



PureBytes Links

Trading Reference Links

hello,

could anybody explain to me the variable visibility/accessability topic when mixing AFL with JS? for example, I have no problem with the following code:

EnableScript("jscript");
<%
function fjsDoArray( jsStr ) {
  jsStr += "postfix";
  AFL(jsStr) = [];
  AFL(jsStr) = AFL("Low");
  jsStr = "prefix" + jsStr;
  AFL(jsStr) = [];
}
%>
objScript=GetScriptObject();
objScript.fjsDoArray("name");
Plot(namepostfix, "namepost", colorRed);
prefixnamepostfix = H;
Plot(prefixnamepostfix, "prenamepost", colorGreen);

whereas this fails with comment: "Variable 'namepostfix' used without having been initialized."

EnableScript("jscript");
function fDoArray( aflStr ) {
  local str;
        str = aflStr;
<%
  var jsStr = AFL("str") + "postfix";
  AFL(jsStr) = new Array();
%>
}
fDoArray("name");
Plot(namepostfix, "namepost", colorRed);


why do fjsDoArray() work whereas fDoArray() does not? I would greatly appreciate explanations..

chrers,
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/