Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Posted: 06 Nov 2008 at 6:32am
Okie............
This formula converts a Hex string parameter (RefNumber) to a decimal value:
// Hex To Dec numberVar x := len({?RefNumber}); numberVar base16 := 1; numberVar value := 0; numberVar decval := 0; stringVar s;
while x > 0 do ( s := mid({?RefNumber},x,1); if s = "F" then decval := 15 else if s = "E" then decval := 14 else if s = "D" then decval := 13 else if s = "C" then decval := 12 else if s = "B" then decval := 11 else if s = "A" then decval := 10 else decval := cdbl(s);
value := value + (base16 * decval); base16 := base16 * 16; x := x - 1; );
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum