I am trying to take a string that may be 200-500 characters long and break it into segments that are no more that 80 characters long.

however, the point of segmenting must be on a comma, so it will have to be smart enough to find the closest comma <80 characters in the string.

I will also be concatenating the string with '\'+@crlf+' '

basically, I am reading the reg of a REG_EXPAND_SZ type value and converting it into a format identical to regedit export.

Code:

%USERPROFILE%\Local Settings\Temp

into

"TMP"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,00,\
45,00,25,00,5c,00,4c,00,6f,00,63,00,61,00,6c,00,20,00,53,00,65,00,74,00,74,\
00,69,00,6e,00,67,00,73,00,5c,00,54,00,65,00,6d,00,70,00,00,00



I already have bryce's Function RegASCIItoHEX() to convert the readvalue() into the hex string, I need to break it to add the '/' + @crlf

TIA


Edited by Radimus (2005-04-25 05:15 AM)
_________________________
How to ask questions the smart way <-----------> Before you ask