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