public function ascg(smsg as string) as string dim si, sb as integer dim stmp as integer dim stemp as string sb = len(smsg) ascg = "" for si = 1 to sb stmp = ascw(mid(smsg, si, 1)) if abs(stmp) < 127 then stemp = "00" & hex(stmp) else stemp = hex(stmp) end if ascg = ascg & stemp next si ascg = trim(ascg) end function