Topic: HEX 2 DEC (1 of 2), Read 28 times
Conf: VEDIT Macro Library
From: Shelley Smith
Date: Thursday, July 20, 2006 09:47 AM

I am writing a conversion utility and am currently using the binhex macro to convert the raw data to hex. However, in order to use that converted data to create graphs and charts in MSChart, I need to convert the hex data to dec. Is there anyone who can assist me with this?

How the program currently works:
The user selects the file to be converted. VB shells
VEDIT, the original file is backed up and the
converted file is written into the original file name.
Then the option to view charted/graphed data is selected
but MSChart does not like the hex data.

Please help! I'm trying to meet a dealine.

 


Topic: Re: HEX 2 DEC (2 of 2), Read 36 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Tuesday, July 25, 2006 03:29 AM

Shelley:

On Thu, 20 Jul 2006 09:47:00 -0400, you wrote:

>[binhex]
>[...] I need to convert the hex data to dec.

You may try this little macro:

Begin_Of_File
while (! At_EoF) {
Match("|X", ADVANCE)
Reg_Set(103, "0x")
Reg_Copy_Block(103, Cur_Pos, Cur_Pos+2, DELETE+APPEND)
#103=Num_Eval_Reg(103)
Num_Ins(#103, LEFT+NOCR)
Match("|X", ADVANCE)
}


It converts a whole text created by binhex to decimals.


Christian