Program Prog1;
var 
Code,Code_1: string;
KM: Integer;

                                  
                              
Procedure ReadKM;
begin                                                 
  if not ReadDevice then      
   begin                                     
    MsgBox( 'Read Error', 'Error', MB_OK );                       
   end                                                                                                                       
  else                                                  
   begin                                                                                
    AddMsg('VW Polo MM 2007 9s12h256');                                              
                       
    Code_1:=inttohex(GetByteHexEdit($600),2)+inttohex(GetByteHexEdit($601),2)+inttohex(GetByteHexEdit($602),2)+inttohex(GetByteHexEdit($603),2);
    KM:= (strtoint('$'+Code_1)/1000);                                                                  
    //KM:= ($ffff-strtoint('$'+Code_1));                
    AddMsg('Actual value' + ' = '+ IntToStr(KM)+' km'); 
    MsgBox(IntToStr(KM) +' km', 'Actual value', MB_OK);          
   end;                                                                                                                            
end;                                                                        
                                                           
procedure NewKM;                                                                                                
var                                                     
n,new_KM, new_KM2: integer;
n1,n2: String;
                                           
begin   
  SetProgramModifiedOnly( true );            
  if InBox( 'Enter KM', 'New KM', code ) then begin
                 
    end;
    if  StrToInt( code )> 999999 then begin
      MsgBox( 'Enter 000001-999999 Code', 'Error', MB_OK );    
      exit;                    
    end;                         

    n:= StrToInt( code )*1000;
    new_KM2:= $FFFFFFFF-(n);          
    new_KM:= (n);
    n1:= IntToHex(new_KM,8);
    n2:= IntToHex (new_KM2,4);

   SetByteHexEdit( $600,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $601,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $602,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $603,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $608,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $609,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $60A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $60B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $610,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $611,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $612,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $613,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $618,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $619,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $61A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $61B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $620,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $621,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $622,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $623,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $628,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $629,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $62A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $62B,(strtoint ('$'+n1[7]+n1[8])));  
   SetByteHexEdit( $630,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $631,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $632,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $633,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $638,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $639,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $63A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $63B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $640,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $641,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $642,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $643,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $648,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $649,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $64A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $64B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $650,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $651,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $652,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $653,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $658,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $659,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $65A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $65B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $660,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $661,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $662,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $663,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $668,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $669,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $66A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $66B,(strtoint ('$'+n1[7]+n1[8])));  
   SetByteHexEdit( $670,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $671,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $672,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $673,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $678,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $679,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $67A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $67B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $680,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $681,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $682,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $683,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $688,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $689,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $68A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $68B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $690,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $691,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $692,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $693,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $698,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $699,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $69A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $69B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6A0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6A1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6A2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6A3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6A8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6A9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6AA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6AB,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $6B0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6B1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6B2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6B3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6B8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6B9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6BA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6BB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6C0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6C1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6C2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6C3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6C8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6C9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6CA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6CB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6D0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6D1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6D2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6D3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6D8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6D9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6DA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6DB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6E0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6E1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6E2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6E3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6E8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6E9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6EA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6EB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6F0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6F1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6F2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6F3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $6F8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $6F9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $6FA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $6FB,(strtoint ('$'+n1[7]+n1[8]))); 
   
   SetByteHexEdit( $700,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $701,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $702,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $703,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $708,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $709,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $70A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $70B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $710,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $711,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $712,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $713,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $718,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $719,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $71A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $71B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $720,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $721,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $722,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $723,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $728,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $729,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $72A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $72B,(strtoint ('$'+n1[7]+n1[8])));  
   SetByteHexEdit( $730,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $731,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $732,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $733,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $738,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $739,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $73A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $73B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $740,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $741,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $742,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $743,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $748,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $749,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $74A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $74B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $750,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $751,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $752,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $753,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $758,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $759,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $75A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $75B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $760,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $761,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $762,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $763,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $768,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $769,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $76A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $76B,(strtoint ('$'+n1[7]+n1[8])));  
   SetByteHexEdit( $770,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $771,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $772,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $773,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $778,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $779,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $77A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $77B,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $780,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $781,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $782,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $783,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $788,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $789,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $78A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $78B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $790,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $791,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $792,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $793,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $798,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $799,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $79A,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $79B,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7A0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7A1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7A2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7A3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7A8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7A9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7AA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7AB,(strtoint ('$'+n1[7]+n1[8]))); 
   SetByteHexEdit( $7B0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7B1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7B2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7B3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7B8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7B9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7BA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7BB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7C0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7C1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7C2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7C3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7C8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7C9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7CA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7CB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7D0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7D1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7D2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7D3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7D8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7D9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7DA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7DB,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7E0,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7E1,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7E2,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7E3,(strtoint ('$'+n1[7]+n1[8])));
   SetByteHexEdit( $7E8,(strtoint ('$'+n1[1]+n1[2])));
   SetByteHexEdit( $7E9,(strtoint ('$'+n1[3]+n1[4]))); 
   SetByteHexEdit( $7EA,(strtoint ('$'+n1[5]+n1[6])));
   SetByteHexEdit( $7EB,(strtoint ('$'+n1[7]+n1[8])));
  
   
   SetByteHexEdit( $604,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $605,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $606,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $607,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $60C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $60D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $60E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $60F,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $614,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $615,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $616,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $617,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $61C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $61D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $61E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $61F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $624,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $625,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $626,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $627,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $62C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $62D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $62E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $62F,(strtoint ('$'+n2[7]+n2[8])));                               
   SetByteHexEdit( $634,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $635,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $636,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $637,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $63C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $63D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $63E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $63F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $644,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $645,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $646,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $647,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $64C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $64D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $64E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $64F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $654,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $655,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $656,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $657,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $65C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $65D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $65E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $65F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $664,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $665,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $666,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $667,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $66C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $66D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $66E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $66F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $674,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $675,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $676,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $677,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $67C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $67D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $67E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $67F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $684,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $685,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $686,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $687,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $68C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $68D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $68E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $68F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $694,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $695,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $696,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $697,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $69C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $69D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $69E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $69F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $6A4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6A5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6A6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6A7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6AC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6AD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6AE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6AF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $6B4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6B5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6B6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6B7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6BC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6BD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6BE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6BF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $6C4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6C5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6C6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6C7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6CC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6CD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6CE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6CF,(strtoint ('$'+n2[7]+n2[8])));        
   SetByteHexEdit( $6D4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6D5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6D6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6D7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6DC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6DD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6DE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6DF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $6E4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6E5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6E6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6E7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6EC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6ED,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6EE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6EF,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6F4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6F5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6F6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6F7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $6FC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $6FD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $6FE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $6FF,(strtoint ('$'+n2[7]+n2[8])));   
   
   SetByteHexEdit( $704,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $705,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $706,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $707,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $70C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $70D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $70E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $70F,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $714,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $715,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $716,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $717,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $71C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $71D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $71E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $71F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $724,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $725,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $726,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $727,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $72C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $72D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $72E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $72F,(strtoint ('$'+n2[7]+n2[8])));                               
   SetByteHexEdit( $734,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $735,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $736,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $737,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $73C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $73D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $73E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $73F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $744,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $745,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $746,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $747,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $74C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $74D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $74E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $74F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $754,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $755,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $756,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $757,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $75C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $75D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $75E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $75F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $764,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $765,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $766,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $767,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $76C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $76D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $76E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $76F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $774,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $775,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $776,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $777,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $77C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $77D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $77E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $77F,(strtoint ('$'+n2[7]+n2[8])));   
   SetByteHexEdit( $784,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $785,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $786,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $787,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $78C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $78D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $78E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $78F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $794,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $795,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $796,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $797,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $79C,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $79D,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $79E,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $79F,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $7A4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7A5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7A6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7A7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $7AC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7AD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7AE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7AF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $7B4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7B5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7B6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7B7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $7BC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7BD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7BE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7BF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $7C4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7C5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7C6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7C7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $7CC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7CD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7CE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7CF,(strtoint ('$'+n2[7]+n2[8])));        
   SetByteHexEdit( $7D4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7D5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7D6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7D7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $7DC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7DD,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7DE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7DF,(strtoint ('$'+n2[7]+n2[8])));    
   SetByteHexEdit( $7E4,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7E5,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7E6,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7E7,(strtoint ('$'+n2[7]+n2[8])));
   SetByteHexEdit( $7EC,(strtoint ('$'+n2[1]+n2[2])));
   SetByteHexEdit( $7ED,(strtoint ('$'+n2[3]+n2[4]))); 
   SetByteHexEdit( $7EE,(strtoint ('$'+n2[5]+n2[6])));
   SetByteHexEdit( $7EF,(strtoint ('$'+n2[7]+n2[8])));
  
   
    RefreshHexEdit;                     
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    SetProgramModifiedOnly( true );                                                   
    ProgramDevice;
    VerifyDevice;                                                                                 
    ReadKM;                                                                                                         
    end;                                                                                  
 
end;
                                              

                                                                                                     
                                                                                                 
begin                                                                     
  AddDeviceGroup( 'VW', 'Select a car' );                                     
  AddDevice('VW Polo MM 2007 9s12h256', 'MC9S12H56', 'VW', 'MC9S12H256' ); 
  AddAction( 'Read KM', 'ReadKM', 'VW Polo MM 2007 9s12h256' );                                                            
  AddAction( 'New KM', 'NewKM',  'VW Polo MM 2007 9s12h256' );                                                       
  //AddOpenFileAction( 'Connection', 'Mini 2004 2005 BCU 93C76', 'mini3.jpg' );  
  //AddOpenFileAction( 'Pinout', 'Mini 2004 2005 BCU 93C76', 'mini2.jpg' );
  //AddOpenFileAction( 'Front dash', 'Mini 2004 2005 BCU 93C76', 'mini.jpg' ); 
  AddMsg('Script (vw_polo_mm_2007_9s12h256.uds) Installed '#169' 2010 DRPETER ');          
  SetProductInfo( 'VW Polo MM 2007 9s12h256', 'Device Script'#$D'Copyright'#169' DRPETER 2010' );
end.                                                                           
                                                                              
