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

[amibroker] Wierd Programming Problem- Please help!



PureBytes Links

Trading Reference Links

Either this is weird, or I am stupid! Let's see which it is. LOL! 
Please help me to figure out this programming problem. I have spent 
hours getting a code to work and I have finally found the strange 
and problem part and here is some test code:
------------------------------------------------------
StaticVarSetText( "Symbol_Name1", "ATI" );
StaticVarSetText( "Symbol_Name2", "ATI" );

TempName1 =  StaticVarGetText("Symbol_Name1");
TempName2 = StaticVarGetText("Symbol_Name2");

if( TempName1 != TempName2 )
{
  Say("New Symbol");
}

GfxTextOut( TempName1 , x2Bull/4 , (y2Main/2));
GfxTextOut( TempName2, x2Bull/3 , (y2Main/2));
------------------------------------------------------

This works and when I change for example one "ATI" to "ATI2", the 
program will recognize it's a difference and say "New Symbol". And 
the symbols show up correctly on the screen.

But when I change for example 
"StaticVarSetText( "Symbol_Name2", "ATI" );" to 
"StaticVarSetText( "Symbol_Name2", Name() );"

It doesn't work anymore, and the program say "New Symbol" all the 
time, despite the fact that in my opinion both have the same symbol- 
my current symbol is ATI, so that's what Name() picks up. And the 2 
GfxTextOut plot both ATI on the screen.!??

So either I can't mix and compare Name() with StaticVarSetText and 
StaticVarGetText- or it is something else. Please advice.

The problem I am trying to solve is how to get the program to 
recognize that I change the chart to another symbol. So if there is 
a better way to that that with programming- please let me know.

Looking forward to finally get this solved. :-)

Thanks and Regards,

Jorgen



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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