Clear StaticVarSetText Id

where to find duplicated id and clear them

code was modified by Mr: PanoS

function MAQEditNumber( idEdit, initialValue,  MD_MAQ_x,  MD_MAQ_y, width, height, textColor, bgColor )
{  // this function hold the text for the next restart of Amibroker
    global _x0, _y0;
    local rc ;

     MD_MAQ_x =  MD_MAQ_x + _x0;      MD_MAQ_y =  MD_MAQ_y + _y0;
    rc = GuiEdit( idEdit,  MD_MAQ_x,  MD_MAQ_y, width, height, notifyHitReturn ); //

    ID = GuiGetEvent( 0, 0 );     event = GuiGetEvent( 0, 1 );
    if( ID == idEdit ) StaticVarSetText( "sV" + Name() + idEdit,  GuiGetText( idEdit ), 1 );

    if( rc == guiNew )
    {  // after restart Amibroker read FIRST these Static Line
        txt = StaticVarGettext( "sV" + Name() + idEdit );
        GuiSetText( txt, idEdit );

    GuiSetColors( idEdit, idEdit, 5, colorWhite, colorYellow, colorLightGrey );

    return GuiGetValue( idEdit );

when I enter number in text box ( gfx / GUI) it will be saved .

where I can find it ? to delete it .

thank you


If I understood correctly, you don't want to change the ID, but you want to delete the TEXT from a GuiEdit

The easiest way for you is to change the value of this box manually. Instead of entering a new number in the GuiEdit box then, write the value zero

if that answer doesn't work for you then you should be clear. Tell us what you want to do and why?

I am sorry I did not explain it right .
I used the function in many AFL for test my strategy.
i used the number ( 1,2,3,4,5,...70,..ETC )
MAQEditNumber( 1,
MAQEditNumber( 2,
MAQEditNumber( 3,
so if I use 37 i will have error
( Duplicate id found control ids must be unique )
because I used it before . but I did not know now which number that I did not use until now .

I change ( idEdit, initialValue, ) to different name and i change "sV" to different name but still i will have the error .

I had the same error and you solve it .

that time the unique ids was around ( more than 130 ) as I remember .

thank you

i find the issue
the txtbox was inside

for ( i = 0; i < rownum; i++ )

it was here
ssss = MAQEditNumber( 1, 0 , x, y , x , y , colorDefault, colorDefault)  ;


I think I will be in another issue .
most of the calculation is inside ( for )
I just remove it from inside the for and inside for

TTT = ssss ;

thank you Mr.: PanoS for your reply

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.