we continue ...
In the example that we will see next:
- Functions
- Arrays
- Input Dialog
- and we will modify the dump buffer from the script by editing the code of a Peugeot/Citroen Pioneer dump and restarting the counter. highlighting any modification with the MARK command.
- using an abbreviated IF condition we call the function
pioneerPeugeot.hpl
;....................tested on DEH-m1107/1407/1507/1807/2107
;[SETUP]
@1634={
0x19,0xD9,0x016,0x05,0x11,0xC3,0xC8}
; array are declared with '@' before tag name.
@1213={
0x02,0xE0,0x12,0x04,0x11,0x47,0xF4}
;----------------------------------------------------------------------------------------------------
[_OPTION1] ;...............Begin Function named _OPTION1
ADR=0x6b ;................Set Position in Address 0x6b
LOOP(7){ ;..................the LOOP begins and the code between brackets will be repeated 7 times
R1=@1634[I] ;............Store in Registry R1 actual value os Array @1634.
;................................'[I]' are index of array. First round is 0x019, second round 0xD9, etc
DATA=R1 ;................ Put in current buffer address , current array value stored in: R1=@1634[I]
MARK=R1 ;................ Put a Mark in current buffer address
ADR=+1 ;..................increment address position
} ;.............................end LOOP
;...............................End Function
;----------------------------------------------------------------------------------------------------
[_OPTION2];..............Begin Function named _OPTION2
ADR=0x6b;................Set Position in Address 0x6b
LOOP(7){
;..................the LOOP begins and the code between brackets will be repeated 7 times
R1=@1213[I]
;............Store in Registry R1 actual value os Array @1213.
;................................'[I]' are index of array. First round is 0x019, second round 0xD9, etc
DATA=R1
;..................Put in current buffer address , current array value stored in: R1=@1213[I]
MARK=R1
;..................Put a Mark in current buffer address
ADR=+1
;...................increment address position
}
;............................end LOOP
;................................End Function
;----------------------------------------------------------------------------------------------------
["#!Change Code"]
;............................................a Button!
GET=("
Choose Between 1=1634 2=1213",R7)
;.... open a Dialog box with data entry stored in R7
R7?1{_OPTION1}
;......R7?1{.........}... ....R7?1 = IF R7 is equal to 1 then call a Function _OPTION1
R7?2{_OPTION2}
;......R7?1{.........}... ....R7?2 = IF R7 is equal to 2 then call a Function _OPTION2
["#!Reset Counter"]
ADR=396H;............... Set Position in Address 396H
DATA=0 ;...................Set to zero '0' address 396H
MARK=1;....................Put a Mark in current buffer address
Bookmarks