Announcement

Collapse
No announcement yet.

Vompiler bug in the If-statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vompiler bug in the If-statement

    In the documentatrion of the 4DGL I read that expressions like
    if(condition) statement;
    schlud be possible.
    Now I tried this with an image command from which is defined as constant from a gc-file.

    [HTML]
    func UpdateClimateInfo()
    var i;
    txt_Set(TEXT_OPACITY, OPAQUE);
    txt_Set(TEXT_COLOUR,GREEN);
    txt_Set(FONT_SIZE, FONT3);

    gfx_MoveTo(180,15);
    to(GFX);putstr(sTemp);
    gfx_MoveTo(180,35);
    to(GFX);putstr(sHum);
    gfx_MoveTo(180,55);
    to(GFX);putstr(sDew);
    gfx_Set(PEN_SIZE, 1);

    gfx_Rectangle(159,234,159+IconWidth,234+IconWidth,GRAY);

    i:=StrToInt(sWeather);
    if (i==1)
    wetter01_jpg(160,235);
    endif;
    if (i==2)
    wetter02_jpg(160,235);
    endif;
    if (i==3)
    wetter03_jpg(160,235);
    endif;
    if (i==4)
    wetter04_jpg(160,235);
    endif;
    if (i==5)
    wetter05_jpg(160,235);
    endif;
    if (i==6)
    wetter06_jpg(160,235);
    endif;
    if (i==7)
    wetter07_jpg(160,235);
    endif;
    if (i==8)
    wetter08_jpg(160,235);
    endif;
    if (i==9)
    wetter09_jpg(160,235);
    endif;
    if (i==10)
    wetter10_jpg(160,235);
    endif;
    if (i==11)
    wetter11_jpg(160,235);
    endif;
    if (i==12)
    wetter12_jpg(160,235);
    endif;

    endfunc

    This function updates the 3 strings for climate info (top right) of the screen and the Cloudcover Icon (the icon with the stars and clouds). It produces the following screen and works well.
    [i]

    But if I simplify the if-statements like described in the manual I like this
    HTML Code:
    func UpdateClimateInfo()
    var i;
    txt_Set(TEXT_OPACITY, OPAQUE);
    txt_Set(TEXT_COLOUR,GREEN);
    txt_Set(FONT_SIZE, FONT3);
    
    gfx_MoveTo(180,15);
    to(GFX);putstr(sTemp);
    gfx_MoveTo(180,35);
    to(GFX);putstr(sHum);
    gfx_MoveTo(180,55);
    to(GFX);putstr(sDew);
    gfx_Set(PEN_SIZE, 1); 
    
    gfx_Rectangle(159,234,159+IconWidth,234+IconWidth,GRAY);
    
    i:=StrToInt(sWeather);
    if (i==1) wetter01_jpg(160,235); 
    if (i==2) wetter02_jpg(160,235); 
    if (i==3) wetter03_jpg(160,235); 
    if (i==4) wetter04_jpg(160,235); 
    if (i==5) wetter05_jpg(160,235); 
    if (i==6) wetter06_jpg(160,235); 
    if (i==7) wetter07_jpg(160,235); 
    if (i==8) wetter08_jpg(160,235); 
    if (i==9) wetter09_jpg(160,235); 
    if (i==10) wetter10_jpg(160,235); 
    if (i==11) wetter11_jpg(160,235); 
    if (i==12) wetter12_jpg(160,235); 
    
    endfunc
    I will get the following result on the screen. It looks like the bottom right button is copied in the graphics memory.
    [i]

    By the way, the button with the
Working...
X