;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfBinaryFill (hdlBB, intOffset, intCount, strFiller) Return BinaryPokeStr (hdlBB, intOffset, StrFill (strFiller, intCount)) ;.......................................................................................................................................... ; This UDF overlays a string binary buffer with repeated patterns of strFiller ; from starting point intOffset up to intCount length. ; ; The parameter strFiller is a string to be repeated to create the return string. ; If the filler string is empty, then spaces will be used instead. ; ; This UDF is similar to the native WinBatch Function StrFill() ; but offers the option for overlaying a given text string with repeated string patterns. ; ; Return value is the number of bytes written to the buffer. ; ; Detlev Dalitz.20010713 ;.......................................................................................................................................... #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ ; Test hdlBB = BinaryAlloc (1000) intBytes = udfBinaryFill (hdlBB, 0, 1000, "xxx ") intBytes = udfBinaryFill (hdlBB, 10, 19, "#") intBytes = udfBinaryFill (hdlBB, 88, 12, "+!/") intBytes = udfBinaryFill (hdlBB, 995, 5, "=") intBytes = udfBinaryFill (hdlBB, 300, 30, "") strFilled = BinaryPeekStr (hdlBB, 0, BinaryEodGet (hdlBB)) hdlBB = BinaryFree (hdlBB) Message ("Demo udfBinaryFill (hdlBB, intOffset, intCount, strFiller)", strFilled) Exit ;------------------------------------------------------------------------------------------------------------------------------------------