prototype PointerToStr(BYREF STRING, POINTER); prototype HexcharToDec(BYREF INT, STRING); //////////////////////////////////////////////////////////////////////////// // // FUNCTION: PointerToStr(svString, pPointer) // // AUTHOR : Ide Nentjes, ide.nentjes@consul.com, http://www.consul.com // // PURPOSE: Retreive the String to which a pointer points // // RETURNS: nothing // ///////////////////////////////////////////////////////////////////////////// function PointerToStr(svString, pPointer) STRING svText, svChar1,svChar2; POINTER psvText, pnvText; NUMBER nvText, nvLength; INT iOffset, iInt1,iInt2; begin svText = ""; iOffset = 0; pnvText = pPointer; nvText = *pnvText; while (nvText != 0 ) // Convert decimal to Hex Sprintf(svText,"%lX",nvText); // retreive last 2 chars nvLength = StrLength(svText) ; StrSub(svChar1,svText,nvLength-2,1); StrSub(svChar2,svText,nvLength-1,1); // svChar contains the ASCII in Hex. HexcharToDec(iInt1,svChar1); HexcharToDec(iInt2,svChar2); Sprintf(svText,"%c",iInt1*16+iInt2); svString = svString+svText; // Get next iOffset++; pnvText = pPointer+iOffset; nvText = *pnvText; endwhile; end; function HexcharToDec(iInt,svChar) begin switch (svChar) case "0": iInt= 0; case "1": iInt= 1; case "2": iInt= 2; case "3": iInt= 3; case "4": iInt= 4; case "5": iInt= 5; case "6": iInt= 6; case "7": iInt= 7; case "8": iInt= 8; case "9": iInt= 9; case "A": iInt= 10; case "B": iInt= 11; case "C": iInt= 12; case "D": iInt= 13; case "E": iInt= 14; case "F": iInt= 15; endswitch; end; //////////////////////////////////////////////////// STRING svText ; POINTER psvText ; psvText = &svText; PointerToStr(svText,psvText);