[Dashboard\Ford\Focus\Focus 3 (95320) km]

Size(280,300); 

Form
{
    Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);   
    }
    Group("Идентификация",5,70,270,40)
    {
        Label(message," ",0,15);
		
    }
     Group("Информация",5,113,270,40)
    {
        Label(message1," ",0,18);
    }
    Group("Описание",5,155,270,95) 
    {
        Label(lb4,"Калькулятор пробега для Ford Focus 3.",0,20);
        Label(lb5,"EEPROM 95320  ",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Ford.bmp",180,5,0,0);
}
OnShow 
{
   Var0 = 0;
   Var1 = (@0xBE << 16) |(@0xBD << 8)| @0xBC;
   Var2 = (@0xC8 << 16) |(@0xC7 << 8)| @0xC6;
   Var3 = (@0xD2 << 16) |(@0xD1 << 8)| @0xD0;
   Var4 = (@0xDC << 16) |(@0xDB << 8)| @0xDA;
  

   if(Var2 > Var1) {Var0 = Var2;} if(Var2 = Var1) {Var0 = Var2;}
   if(Var3 > Var0) {Var0 = Var3;} if(Var3 = Var0) {Var0 = Var3;}
   if(Var4 > Var0) {Var0 = Var4;} if(Var4 = Var0) {Var0 = Var4;}
 
   if(Var1 > Var0) {Var0 = Var1;} if(Var1 = Var0) {Var0 = Var1;}
   Var0 = Var0 /10;
   Var10 = 0;
    if(Var0 > 999900) {Var10 = 1;}
   if (Var10 = 0)
   {  
    message = "VIN: "+#c.@0x86E+#c.@0x86F+#c.@0x870+#c.@0x871+#c.@0x872+#c.@0x873+#c.@0x874+#c.@0x875+#c.@0x876+#c.@0x877+#c.@0x878+#c.@0x879+#c.@0x87A+#c.@0x87B+#c.@0x87C+#c.@0x87D;
    message1.Bold = 1;
    message1.Color = 0xFF0000;                    
    message1 = "Дамп ОК. Введите новый пробег.";  
    Distance =  Var0;                            
   }
 else
   {
     message.Color = 0x0000FF; 	
     Message1 = "Неверный дамп!";     
     Distance = 0;              
   }
}
OnApply 
{
    Var1 = Distance;
    Var5 = 0;
    if(Var1 > 999900) {Var5 = 1;}
    if(Var1 < 100)   {Var5 = 1;}
    if(Var5 != 0)
    {
        message.Color = 0x0000FF;
        message.Bold = 1;
        message = "Пробег должен быть от 100 до 999900 км";
    }
    else
    { 
       Var1 = Var1 * 10;  

       Var2 = Var1 >> 24; Var3 = Var1 >> 16; 
       Var4 = Var1 >> 8; Var5 = Var1 & 255; 
       Var6 = Var4 ^0xff; Var7 = (((((Var2 + Var3) + Var4) + Var5) + Var6) + 1) ^0xff;
        Var8 = 0xBA;
         @Var8 = Var7; Var8 = Var8 + 1;
         @Var8 = Var6; Var8 = Var8 + 1;
         @Var8 = Var5; Var8 = Var8 + 1;
         @Var8 = Var4; Var8 = Var8 + 1;
         @Var8 = Var3; Var8 = Var8 + 1;
         @Var8 = Var2; Var8 = Var8 + 3;
          Var8 = 0xC4;
         @Var8 = Var7; Var8 = Var8 + 1;
         @Var8 = Var6; Var8 = Var8 + 1;
         @Var8 = Var5; Var8 = Var8 + 1;
         @Var8 = Var4; Var8 = Var8 + 1;
         @Var8 = Var3; Var8 = Var8 + 1;
         @Var8 = Var2; Var8 = Var8 + 3;
            Var8 = 0xCE;
         @Var8 = Var7; Var8 = Var8 + 1;
         @Var8 = Var6; Var8 = Var8 + 1;
         @Var8 = Var5; Var8 = Var8 + 1;
         @Var8 = Var4; Var8 = Var8 + 1;
         @Var8 = Var3; Var8 = Var8 + 1;
         @Var8 = Var2; Var8 = Var8 + 3;
            Var8 = 0xD8;
         @Var8 = Var7; Var8 = Var8 + 1;
         @Var8 = Var6; Var8 = Var8 + 1;
         @Var8 = Var5; Var8 = Var8 + 1;
         @Var8 = Var4; Var8 = Var8 + 1;
         @Var8 = Var3; Var8 = Var8 + 1;
         @Var8 = Var2; Var8 = Var8 + 3;
        
        message.Color = 0xFF0000;
        message.Bold = 1;
        message = "Дамп OK. Новый пробег записан.";
     }
}