[Dashboard\Peugeot\307\BSI 307 95128 Var1]

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,"Калькулятор пробега для BSI Peugeot 307.",0,20);
        Label(lb5,"EEPROM 95128",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Peugeot.bmp",180,5,0,0);
}
OnShow 
{
   Var0 = 0;
   Var1 = (@0x1ce << 16) |(@0x1cd << 8)| @0x1cc;
   Var2 = (@0x1d6 << 16) |(@0x1d5 << 8)| @0x1d4;
   Var3 = (@0x1de << 16) |(@0x1dd << 8)| @0x1dc;
   Var4 = (@0x1e6 << 16) |(@0x1e5 << 8)| @0x1e4;
   Var5 = (@0x1ee << 16) |(@0x1ed << 8)| @0x1ec;
   Var6 = (@0x1f6 << 16) |(@0x1f5 << 8)| @0x1f4;
   Var7 = (@0x1fe << 16) |(@0x1fd << 8)| @0x1fc;
   Var8 = (@0x206 << 16) |(@0x205 << 8)| @0x204;

   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(Var5 > Var0) {Var0 = Var5;} if(Var5 = Var0) {Var0 = Var5;}
   if(Var6 > Var0) {Var0 = Var6;} if(Var6 = Var0) {Var0 = Var6;}
   if(Var7 > Var0) {Var0 = Var7;} if(Var7 = Var0) {Var0 = Var7;}
   if(Var8 > Var0) {Var0 = Var8;} if(Var8 = Var0) {Var0 = Var8;}
   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.@0x168+#c.@0x167+#c.@0x166+#c.@0x165+#c.@0x164+#c.@0x163+#c.@0x162+#c.@0x161+#c.@0x160+#c.@0x15f+#c.@0x15e+#c.@0x15d+#c.@0x15c+#c.@0x15b+#c.@0x15a+#c.@0x159;
    message1.Bold = 1;
    message1.Color = 0xFF0000;                    
    message1 = "Дамп ОК. Введите новый пробег.";  
    Distance =  Var0;                            
   }
 else
   {
     message1.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 = 0x1ca;
       while (Var8 != 0x20a)
        {
         @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. Новый пробег записан.";
     }
}