Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Splitting Registry Binary Entry for Writing to INI File

Keywords: 	 split binary value

Question:

I am using the RegQueryBin command to get a binary value from the registry. What I want to do is cut it up into 255 byte chunks so I can stick it in an .ini file to use later.

Answer:

Ummm writing undebugged code at random here
	bin=RegQuerybin(...

	binlen=strlen(bin)
	chunksize=240

	;note integer divide
	chunks=((binlen-1)/chunksize)+1

	for xx=1 to chunks
	thischunk=strsub(bin,xx*chunksize+1,chunksize)
	IniWritePvt("BIN","xyz%xx%",thischunk,inifile)
	next

Article ID:   W12736
Filename:   Splitting Registry Binary Entry for Writing to INI File.txt