Hello bone fonny!
Theoretically it's easy to manage the task with some loops.
For a sample macro see below. (Sorry for the strange form. Webboard isn't easy to handle with code ...)
Only the problem with negative numbers is a bit tricky.
I marked my solution with "// -- patch" in the macro.
But that patch should be deleted when VEDIT could work with negative hex numbers again!
(Ted, are you listening here?)
Christian
// File_Open("input.txt")
#90 = Buf_Num
#91 = Buf_Free()
Buf_Switch(#91)
// File_Save_As("output.txt", OK)
Buf_Switch(#90)
BoF
while( ! At_EoF){
Buf_Switch(#91) // Insert object header into the output buffer
Ins_Text("Object1")
Ins_Newline(1)
Buf_Switch(#90)
for(#95=1 ; #95<=3 ; #95++){ // loop 3 times for three numbers => 9 items
Search("|X", ADVANCE+NOERR+ERRBREAK) // skip the first (unneeded) number
for(#99=1 ; #99<=3 ; #99++){ // read three values
Reg_Empty(98)
#80=0 // -- Patch to make negative hex values possible
#81=0 // --
if(Match("|{F,E,D,C,B,A,9,8}")==0){ // -- check the first hex digit
if(Match_Item == 8){ // -- "8" must be done separately due to number size
#80=2147483647 // --
#81=1 // --
}else{ // --
Reg_Set(80, "0x") // --
Num_Str(Match_Item, 80, LEFT+NOCR+APPEND) // -- build the value to subtract later
Reg_Set(80, "0000000", APPEND) // --
#80=Num_Eval_Reg(80) // --
#81=0 // --
} // --
Reg_Set(98, "0") // -- set the first digit to 0 in the following evaluation
Char(1) // --
} // --
#92 = Cur_Pos // remember the beginning of the current number
Search("|X", NOERR) // search end of current number
if(Error_Match){ // no extended whitespace found => EoF reached
return
}
Reg_Set(98, "0x", INSERT)
Reg_Copy_Block(98, #92, Cur_Pos, APPEND) // copy the current number in the hex prepared text register
#98 = Num_Eval_Reg(98) // evaluate the value
#98 = #98 - #80 - #81 // -- patch continued: subtract to have correct negative value
Buf_Switch(#91) // switch to output buffer
Ins_Text(" ")
Num_Ins(#98, LEFT+NOCR)
Ins_Text(".000000")
Buf_Switch(#90) // switch back to input buffer
Search("|X", ADVANCE+NOERR+ERRBREAK) // proceed to beginning of next number
}
}
Buf_Switch(#91) // object finished => insert CR/LF into output buffer
Ins_Newline(1)
Buf_Switch(#90) // switch back to input buffer
}
BoF
Buf_Switch(#91)
BoF