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

Re: [amibroker] quoted text from variable assignments showing up in interpretation???



PureBytes Links

Trading Reference Links




Dave,
 
The logic is very simple. As in C/C++ each assignment 
statement in AFL has a VALUE.
This nice feature allows statements like this:
 
a = b = c = 1;
 
(assign 1 to a, b, and c variables at once )
 
which is NOT possible in other languages like Pascal, Basic, 
etc.
 
This allows also to make assignments inside conditional 
expressions
 

_N( tickerlist = 
"INTC,MSFT,AAPL" 
);
p = 0<FONT 
face="Courier New">;
for( i = <FONT face="Courier New" 
color=#ff00ff>0; ( ticker = <FONT 
face="Courier New" color=#0000ff>StrExtract<FONT 
face="Courier New">(tickerlist, i ) ) != <FONT face="Courier New" 
color=#ff00ff>""; i++ ) // assignment inside 
for-condition{  p = p + 
Foreign<FONT 
face="Courier New">( ticker, <FONT face="Courier New" 
color=#ff00ff>"C" 
);} 
 
The value of text assignment is text itself.
 
Variable = "Text";
 
statement has a string value of "Text" and that's why it is 
displayed by default.
This is the same as you would write:
 
"Text";
 
You can easily change this behaviour by using
EnableTextOutput( False );
 
 
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Dave Merrill 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, August 21, 2003 4:12 
  PM
  Subject: RE: [amibroker] quoted text from 
  variable assignments showing up in interpretation???
  
  <FONT face="Courier New" color=#0000ff 
  size=2>thanks, haven't tried it yet, but you've called my attention to what 
  looks like one way to do this. I also found EnableTextOutput, which should 
  also work.
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <FONT face="Courier New" color=#0000ff 
  size=2>I had missed the fundamental fact that quoted text, even on 
  the right-hand side of an expression, goes to the interpretation window. this 
  is deeply strange to me. I can see the idea that simply outputting some text 
  in the middle of code causes it to appear in the interpretation. for example, 
  you could include the line
  <FONT face="Courier New" color=#0000ff 
  size=2>    Name();
  <FONT face="Courier New" color=#0000ff 
  size=2>...to output the current ticker. still, I'm intuitively mystified that 
  text contained within an expression, and not in a statement that itself 
  evaluates as text, still shows. it's hard for me to understand why this is 
  desirable behavior. it seems more natural that you'd get output only from 
  statements that evaluate as text. but I can cope (:-).
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <FONT face="Courier New" color=#0000ff 
  size=2>also, output only happens in some cases; this line:
  <FONT face="Courier New" color=#0000ff 
  size=2>    IndexPrice = Foreign(IndexTicker, 
  "C")
  <FONT face="Courier New" color=#0000ff 
  size=2>...doesn't output the "C". there must be some logic here that escapes 
  me, but again, I can cope.
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <FONT face="Courier New" color=#0000ff 
  size=2>anyway, so be it, that's how it is, and I think I understand how to 
  work with it.
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <FONT face="Courier New" color=#0000ff 
  size=2>thanks for the steer,
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <FONT face="Courier New" color=#0000ff 
  size=2>dave
  <FONT face="Courier New" color=#0000ff 
  size=2> 
  <BLOCKQUOTE 
  >
    I 
    believe you can write the line as this;
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2>_N(IndexTicker = "VFINX");
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2>This will stop the printing of the text.
    <FONT face=Arial color=#0000ff 
    size=2> 
    <FONT face=Arial color=#0000ff 
    size=2>Paul.
    working on a series of charts 
      with interpretations, it appears that quotedtext from assignments made 
      in the charting code appears in theinterpretation area.for 
      example, the following is used before the '//--Indicator-End—', 
      sinceit's part of the charting code:---------------IndexTicker 
      = "VFINX";IndexPrice = Foreign(IndexTicker, 
      "C");      [other code that uses the variable 
      IndexTicker]---------------for some reason, the string "VFINX" 
      (no quotes) shows up in theinterpretation. how can I make a string 
      assignment without this happening?thanks,Dave 
    MerrillSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.